WebPagetest Forums
sendKeyDownAndWait not working - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: General Discussion (/forumdisplay.php?fid=25)
+--- Thread: sendKeyDownAndWait not working (/showthread.php?tid=14710)

sendKeyDownAndWait not working - shraddha - 01-20-2017 09:42 PM

sendKeyDownAndWait command is not working in a search bar.
Link of the site is below:

clickAndwait and javascript is also not working.
Please help me with this issue.

RE: sendKeyDownAndWait not working - andydavies - 01-24-2017 01:21 AM

If the page already has jQuery on it you can use the same approach I used on the Trainline site

It's about half way through this deck - https://ldnwebperf.org/sessions/using-webpagetest-scriptingapiprivat%C2%ADe-instances/

RE: sendKeyDownAndWait not working - shraddha - 01-24-2017 10:02 PM

Thank you for the reply.

Jquery is working in console, but not in webpagetest.
Following is the script I am running.
I am running it for payment page.
As $("#cardNumber").keydown() wasn't working I tried with other Jquery commands and they are working in console.

execAndWait $("#cardNumber").trigger("focusin")
execAndWait document.querySelector("#cardNumber").value="XXXX XXXX XXXX XXXX"
execAndWait $("#cardNumber").trigger("focusout")
execAndWait document.querySelector("#expiry").value="05/25"
execAndWait $("#expiry").trigger("focusout")
execAndWait $("#cvv").trigger("focusin")
execAndWait document.getElementById("cvv").value="***"
execAndWait $("#cvv").trigger("focusout")
execAndWait document.getElementById("cardName").value="Pappy Pp"
execAndWait $("#cardName").trigger("focusout")