Monday, June 6, 2016

Popup interactive in Selenimum

When develop AWATT tool, i got this problem: after click, pop up alert windows show and must confirm (accept, dismiss) to continue.
You can not use selector of selenium to control it. This is  solution:

from selenium import webdriver
import time
url = "http://www.javascripter.net/faq/alert.htm"
driver = webdriver.Firefox()
driver.get(url)
element = driver.find_element_by_xpath("//input[@type='button']")
element.click()
alert = driver.switch_to_alert()
time.sleep(2)
alert.accept()
# alert.dismiss()

----------------------------------------------------------
Thanks for reading
--------------------------------------------------------------------------
Security Research
SecurityLab - Linux Lab -- Window and Cisco Lab
to be continued - I will update more.

No comments:

Install Xposed Inspector and Frida on Genymotion

Today i had some work with android. So i need trace application. I found 2 nice tool can help me: Xposed Inspector and Frida. To setup ther...