Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clear()方法无法使用 #141

Closed
sobbingchild opened this issue Aug 26, 2022 · 1 comment
Closed

clear()方法无法使用 #141

sobbingchild opened this issue Aug 26, 2022 · 1 comment

Comments

@sobbingchild
Copy link

sobbingchild commented Aug 26, 2022

文档链接:https://github.com/SeldomQA/seldom/blob/master/docs/rst_docs/seldom_api.rst
image
根据文档内容使用clear方法,发现无法清除输入框内容,报告展示已经执行,但是并未产生任何效果
self.clear(css="#el")
image
image

@defnngj
Copy link
Collaborator

defnngj commented Aug 29, 2022

clear() 封装的selenium 的方法,如果是输入框,并且是可以输入的内容;是可以清空的; 如果无效,你可以试试js的方式。比如:

document.querySelector("#id").value = ""

seldom 可以执行

self.execute_script('document.querySelector("#id").value = ""')

@defnngj defnngj closed this as completed Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants