added function for sending data with js and double checking that it got input

pull/2/head
Yuriy 2 years ago
parent d11f9ef94c
commit ea4552dde8

@ -16,6 +16,25 @@ JS_TryToExecute(JsToExecute,NumberofAttempts := 1,SleepLength:=1000){
js_SendAndCheckWithQuerySelector(Selector,ValueToCheck:="value",SleepLength:=1000,JSStringText:="TEXT"){
js = document.querySelector("%Selector%").value = "%JSStringText%";
try driver.executeScript(js)
sleep, %SleepLength%
js = return document.querySelector("#title").value;
try, status := driver.executeScript(js)
; DevModeMsgBox(status)
if(Status = "")
return "Failed"
else,
return ""
}
; ValueToCheckOptions = innertext,textContent,InnerHTML,outerHTML,value,href,option value ; ValueToCheckOptions = innertext,textContent,InnerHTML,outerHTML,value,href,option value
js_SendAndCheckWithClassName(ClassName:="",ClassIndexNum:=0,ValueToCheck:="textContent",SleepLength:=1000,JSStringText:="TEXT"){ js_SendAndCheckWithClassName(ClassName:="",ClassIndexNum:=0,ValueToCheck:="textContent",SleepLength:=1000,JSStringText:="TEXT"){
jsSend = document.getElementsByClassName('%ClassName%')[%ClassIndexNum%].value = "%JSStringText%"; jsSend = document.getElementsByClassName('%ClassName%')[%ClassIndexNum%].value = "%JSStringText%";

Loading…
Cancel
Save