Invalid argument - WebDriver 编辑
The invalid argument error is a WebDriver error that occurs when the arguments passed to a command are either invalid or malformed.
Invalid argument errors can be likened to TypeError
s in JavaScript, in that they can occur for a great many APIs when the input value is not of the expected type or malformed in some way. See the type- and bounds constraints for each WebDriver command.
Example
It is for example not possible to set a window size to a negative value:
from selenium import webdriver
from selenium.common import exceptions
session = webdriver.Firefox()
try:
session.set_window_size(-100, 0)
except exceptions.InvalidArgumentException as e:
print(e.message)
Output:
InvalidArgumentException: Expected -100 to be >= 0
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论