Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

how to convert to page object

Solved 1 Answers 58 Views Selenium
0 1

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

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"));


answered by

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.