WebPagetest Forums
Click event not triggered on checkbox - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: General Discussion (/forumdisplay.php?fid=25)
+--- Thread: Click event not triggered on checkbox (/showthread.php?tid=14922)



Click event not triggered on checkbox - anilpothala - 06-02-2017 11:15 AM

Hi Guys,


Can some one provide inputs on below script, i was not able to select the checkbox through script.

logData 0
navigate http://www.walmart.com/search/?query=toddler%20toys&typeahead=toys&cat_id=0
logData 1
setEventName scrollDown
execAndWait window.scrollBy(0,1000)
clickAndWait document.querySelector('input[type=checkbox]')[0].click()

script was working only till scroll.

Below is the test run

https://www.webpagetest.org/result/170602_PF_37B/


RE: Click event not triggered on checkbox - sree123 - 11-12-2019 08:12 PM

could you try dispatching a custom event from the checkbox, like
document.querySelector('input[type=checkbox]')[0].dispatchEvent(new InputEvent("input"))