WebDriver commands for elements
WebDriver Commands
There are different ways by which one can read/identify various page elements.
- By Id
- By Xpath
- By linktext
- By Partiallinktext
- By cssselector
- By tagname
Among all of these id selection is better and best programming practice. Usually in hesitation most of the QE automation engineers select through xpath.
Example:
driver.findelement(By.xpath(".//*[@id='navbar']/ul[2]/li[6]/a"))
driver.findElement(By.name("email"));
and likewise.
Comments
Post a Comment