Answer the question
In order to leave comments, you need to log in
Selenium webdriver and multiple popup test case complexity. how to modify the test so that you can enter the popup window?
Good day,
I am writing an autotest for a web application and at a certain point there was a difficulty with the localization of an element and clicking on it.
In the Application Menu, autotest should click on a category. a table (dropdown) with subcategories will appear. move the mouse over a subcategory and another table will appear on the right (the difficulty for me begins at this stage of the test) and you need to select and click on a specific place in the table.
The code I wrote allows you to get to the point where the last table appears. but I can't choose anything.
driver.switchTo().frame(driver.findElement(By.id("MainFrame")));
WebElement MENU = driver.findElement(By.id("Menu"));
List<WebElement> menuItems = MENU.findElements(By.tagName("td"));
menuItems.get(4).click();
Thread.sleep(2000);
WebElement popupMenu = driver.findElement(By.id("PopupMenu"));
List<WebElement> popupList = popupMenu.findElements(By.tagName("tr"));
popupList.get(0).click();
<table id="PopupMenu" cellspacing="0" style="padding-left: 0px; padding-right: 0px; top: 38px; left: 358px; visibility: hidden;">
<tbody>
<tr class="TMenuItem" enabled="true" caption="invoice" type="TMenuItem">
<td class="TMenuIcon" width="9px"> </td>
<td class="TMenuItemCaption">invoice</td>
<td class="TMenuArrow"> </td>
</tr>
<tr class="TMenuItem" enabled="true" caption="invoice2" type="TMenuItem">
<td class="TMenuIcon" width="9px"> </td>
<td class="TMenuItemCaption">invoice2</td>
<td class="TMenuArrow"> </td>
</tr>
</tbody>
</table>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question