mardi 22 décembre 2020

Selenium cant find elements in modal div

I want to create a Selenium test, where a modal dialog is used. If I want to use the element in the div I get the error message that the element cannot be found. I have also tried to switch to the active element, or to switch to the frame. If I make this I get the error, that the frame cannot be found.

This is the html code: enter image description here

This was my idea to switch to the modal:

driver.switchTo().frame(driver.findElement(By.xpath("/html/body/div[8]/div"));

And this is the error I got:

org.openqa.selenium.NoSuchFrameException: Unable to locate frame: 805833b6-6961-41e5-8bdf-3393a28e0ad9

In the end I want to press the button inside the modal. I hope someone can help me to reach this with a selenium java test.




Aucun commentaire:

Enregistrer un commentaire