Welcome to the Question and Answer site for Software Testing Professionals

You can get your queries resolved from Software Testing Professionals.

Ask a Question

Get answers and give answers to questions from other members.

View All Questions

Get votes and earn points to build your reputation in community.

View Hot Questions

how to convert to page object

Solved 1 Answers 52 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.

We have resolved 1.2k+ Software Testing queries!

Software Testing Board Weekly update

We will send you handpicked questions that you would love to answer.

View previous campaigns.

Top Contributors