power_settings_new

how to convert to page object

by
0 votes
81 views

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?

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.

1 Answer

by
0 votes
 
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"));

}

add
...