【发布时间】:2021-02-13 12:31:27
【问题描述】:
我正在尝试运行一个在运行时打开一个新窗口的测试 我的主应用程序中有一个按钮,可以打开一个不同名称的新窗口 我尝试使用:
desired_caps["app"] = 'myappname'
driver = webdriver.Remote(
command_executor='http://127.0.0.1:4723',
desired_capabilities= desired_caps)
driver.find_element_by_name("OK").click()
#after click on this a new window opens with this name, "Confirmation"
driver.switch_to_window("Confirmation")
我也想换个方式写:
webdriver.switch_to.SwitchTo.window(self,"Confirmation")
谁能帮我解决这个问题?
【问题讨论】:
标签: python selenium appium windows-application-driver