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,

  1. read locator property files.
  2. page object model + page factory.
  3. 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

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -