python - selenium not showing pop up when script is running -


i using python-selenium bindings automate webpage. using following line of code press enter button , invoke pop up:

driver.find_element_by_xpath("xpath_of_element").send_keys(u'\ue007') 

the test case pass donot invoke pop-up when script running. know why?

you should try using click() instead of send_keys() below :-

driver.find_element_by_xpath("xpath_of_element").click() 

edited :- if in case pop-up occurred keyboard events try below :-

from selenium.webdriver.common.keys import keys  driver.find_element_by_xpath("xpath_of_element").send_keys(keys.enter) 

hope helps..:)


Comments