0
how to convert to page object

Solved 1 Answers 51 Views Selenium

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
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 Nov 6, 2014 by anonymous
...