selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //a[text(),’单元管理’] because of the following error: SyntaxError: Failed to execute ‘evaluate’ on ‘Document’: The string ‘//a[text(),’单元管理’]’ is not a valid XPath expression. (Session info: chrome=78.0.3904.87)
第30页 3.6.2自定义模块里面的内容拜托作者说明的详细一点好吗,照着书上的指示操作,运行结果是ModuleNotFoundError: No module named ‘calculator’
到现在也没看明白是我操作有误,还是你写的书上的内容有错误,希望作者重视起来!并及时反馈
读者微信号:thesonofJerusalem
第48页,
6.使用text()方法
报错,提示这个方法不熟悉xpath写法。
selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //a[text(),’单元管理’] because of the following error:
SyntaxError: Failed to execute ‘evaluate’ on ‘Document’: The string ‘//a[text(),’单元管理’]’ is not a valid XPath expression.
(Session info: chrome=78.0.3904.87)
书本156页
测试用例
def test_numbers_5_6(self):
print(“test_numbers_5_6”)
assert multiply(5,6) == 30
def test_strings_b_2(self):
print(“test_strings_b_2”)
assert multiply(‘b’,2) == ‘bb’
def test_numbers_5_6(self):与def test_strings_b_2(self):括号中应该没有self
在run_tests上执行后,失败的用例为什么没有截图呢?
@pytest.mark.parametrize(
“username, password, Alert”,
[(“1”, “Selenium”,”登录,用户名或密码错误!”)