I have a table with some data like:
|_name_|___email_____|
|website|website@test.com|
After clicking on the name Website, a settings page of the Website is displayed. On the top, there is a header with the "Website" name.
I need a solution for JUnit to verify that after click on the "Website" name in the table user is redirected to the "Website" settings page.
I tried the way below but didn't help:
String firstNameInTheTable = driver.findElement(By.xpath(TestPage.FIRST_NAME_IN_THE_TABLE)).getText();
driver.findElement(By.xpath(TestPage.FIRST_NAME_IN_THE_TABLE)).click();
assertEquals(firstNameInTheTable, WebsitePage.WEBSITE_TITLE_TEXT);
Actually it would be better to verify that text from the first column ("name" in our case) is the same as on the settings page. So it may happen that we do not have a Website text but another Name. Still the test should pass.