【发布时间】:2021-04-30 11:29:29
【问题描述】:
我正在尝试在 Web 应用程序(Angular2、https 和 websocket)上运行一些测试自动化:gherkin、behave 1.2.6、selenium 3.141.0、firefox 和 python 3.9.4、geckodriver 0.29.1、allure -表现 2.8.40。
配置: user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0"
定位器: select = (By.XPATH, '//div[contains(@class,"connexion-content")]//select')
错误: 断言失败:在当前页面中找不到项目“profilselect.select”,无法在其上设置值 捕获的日志记录:WARNING:root:[ACTION] waitForClickable => "//div[contains(@class,"connexion-content")]//select" 处的元素不可点击。
我要选择的 HTML 选项:请注意不能使用 «值»,因为我只对«选项»标签之间的文本感兴趣,只有当给定文本对应于它的特定值时被选中
【问题讨论】:
标签: python-3.x selenium-webdriver firefox geckodriver python-behave