我需要将selenium与智能卡(opensmc)和firefox驱动程序一起使用。 之后:
...
driver.get("mypage")
driver.find_element_by_link_text("login")
# Here comes the enter pin window (popup)
...
驱动块。opensmc驱动程序发送的“输入智能卡pin”窗口似乎有问题。
为了解决这个问题,我使用xdotool
输入键。你知道吗
现在我在选择任何元素或切换到任何页面时得到一个tryUnexpectedAlertPresentException
:
driver.find_element_by_link_text("logout")
driver.get("http://google.com")
# each throws the tryUnexpectedAlertPresentException
另一方面:
alert = driver.switch_to_alert()
alert.dismiss()
抛出NoAlertPresentException
不管怎样,每一次find_element
都会导致tryUnexpectedAlertException
你能解释一下这种行为以及如何避免这种情况吗?你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐