How to handle a dialog through selenium using python?

I am new to Selenium automation. Could you explain to me how to use this (if any) tag? It would be very helpful if you could give an example.

The scenario in which I encountered a problem: there is a save button, if we click on it, a dialog box will appear. I need to enter text in two text fields and press the save / cancel button in the same dialog box. I use Selenium as a tool and Python as a scripting language. Any help on this would be appreciated.

Thanks in advance!

+3
source share
2 answers
sel.click("idOfSaveButton")
sel.wait_for_pop_up("popupWindowName", "30000")
sel.select_window("name=popupWindowName")
sel.type("idOfTextBox1", "someText")
sel.type("idOfTextBox2", "someText")
sel.click("idOfCloseButton")
sel.select_window("null")

You can also select a popup using title=.

+1
source

, , . , . , .

0

Source: https://habr.com/ru/post/1710132/


All Articles