我连续有3个文本框,我正在使用JS在文本框中输入文本.但问题是当我在一个字段中输入文本并转到第二个框输入文本时,第一个文本框中的值被删除.我们正在使用下面的代码来输入文本
((JavascriptExecutor) webDriver).executeScript("arguments[0].setAttribute('value','"+inputText+"')",元素);试试下面的:
String js = "arguments[0].setAttribute('value','"+inputText+"')"((JavascriptExecutor) webDriver).executeScript(js, element);<块引用>
确保在第二个和第三个text被推送之前,document.readyState == "complete"已经实现.
I have 3 text box in a row, and I am using JS to input the texts in the text boxes. But the problem is when I enter the text in one field, and go to second box to enter the text, the value from first text box is removed. we are using the below code to input text
((JavascriptExecutor) webDriver).executeScript(
"arguments[0].setAttribute('value','"+inputText+"')",
element);
Try the following :
String js = "arguments[0].setAttribute('value','"+inputText+"')"
((JavascriptExecutor) webDriver).executeScript(js, element);
Ensure that the before the second and third
textis being pushed thedocument.readyState == "complete"is achieved.
这篇关于使用JS输入文字,但是如果我在一个文本框中输入文字,已经输入的值被删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
即使在调用 abort (jQuery) 之后,浏览器也会等待Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在调用 abort (jQuery) 之后,浏览器也会等待 ajax 调用
JavaScript innerHTML 不适用于 IE?JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不适用于 IE?)
XMLHttpRequest 无法加载,请求的资源上不存在“AXMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 无法加载,请求的资
XHR HEAD 请求是否有可能不遵循重定向 (301 302)Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 请求是否有可能不遵循重定向 (301 302))
XMLHttpRequest 206 部分内容XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分内容)
XMLHttpRequest 的 getResponseHeader() 的限制?Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)