android - Can i do soft coding in selenium webdriver using java? -
so here's problem have write driver.find() method every element cannot iterated , of course on every page elements change.so question is, there way can soft code test rather hard coding becomes difficult make changes.is there way can parameters or values or xpaths etc table libreoffice.
here part of current implementation:
driver.findelement(by.xpath("//a[contains(.,'modules')]")).click(); driver.findelement(by.xpath("//a[contains(.,'sales module')]")).click(); driver.findelement(by.partiallinktext("file")).click(); driver.findelement(by.xpath("//a[contains(.,'new')]")).click(); driver.findelement(by.partiallinktext("enquiry")).click(); driver.findelement(by.xpath("//a[contains(.,'domestic')]")).click(); if(driver.findelement(by.xpath("//div[contains(.,'sales enquiry form')]"))!=null){ system.out.println("success"); } else{ system.out.println("failed"); }
currently there 3 approaches going on,
- read locator property files.
- page object model + page factory.
- hybridization of above two. page factory difficult need create custompagefactory possible.
choose approach per needs.(how locators changed?, how effort required put in? need long term or short term solution? etc)
now leaving these 3 approaches on stackoverflow or online. discussed many times.
Comments
Post a Comment