Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
218 views
in Selenium by
recategorized by

Working on converting all my previous projects into page objects driven. Have a code in the test class like the following.


WebElement header = driver.findElement(By.className("row-fluid"));
       WebElement our_header = header.findElement(By.tagName("h3"));

how do I write this in the new test class when utilizing page objects?

1 Answer

0 like 0 dislike
by
 
Best answer

You can use something like this.

 

public static WebElement getHeader(WebDriver driver){

WebElement header = driver.findElement(By.className("row-fluid"));
return header.findElement(By.tagName("h3"));

}


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...