how to verify or vlidate that whether the logged in page is the required page or not?

how to verify or vlidate that whether the logged in page is the required page or not?

Ex: if i logged into gmail then we will get a page then how to validate that the oppend page is a home page or not?

lakshmi Default Asked on January 6, 2015 in Selenium WebDriver.

Hi
Validate the Elements that Differentiate Other Pages from Home page,
if those Elements are present that Means its Home page Else not

on January 7, 2015.
Add Comment
1 Answer(s)

As commented by ankit, get the page title of the home page and compare
for example if page title is “Home Page”
if(driver.getTitle().equalsIgnoreCase(“HomePage”)
{
syso(“I am in home page”)
}
else
{
syso(I am not in home page”)
}

or

driver.findElement(By.id(“elementid”)).isDisplayed

pradhakrishna284 Train Answered on January 22, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.