WebPagetest Forums
Script not working - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: Private Instances (/forumdisplay.php?fid=12)
+--- Thread: Script not working (/showthread.php?tid=15378)



Script not working - venkatakurathi - 05-24-2018 09:06 PM

Hi Respected Members,

Apologies if it is not the right board to post this query
also if this question is already asked [unfortunately I couldn't find it..plz refer me ]

I am working on react application...using a private instance of WPT.

This is my targetted script flow.
page -1
launch app : navigate <URL>
click on the login button : execAndWait document.querySelector('.wds-c-navbar a[href="#/login"] .wds-c-button').click()

page -2
enter credentials : exec document.querySelector('.wds-c-form-item input#username').value="username"
exec document.querySelector('.wds-c-form-item input#password').value="password"
click login : execAndWait document.querySelector('button.wds-c-button--success[type="submit"]').click()

page -3
click a button [on logged in dashboard] : execAndWait document.querySelector('.wds-c-button--primary’).click()

I am using javascript commands to achieve this.

The problems I m facing whenever I navigate to a new page I m unable to run actions.
i.e after clicking on the login button on page-1, it takes me to page-2 where I can enter credentials and click the login button. here I m not able to click on login button.

but when I navigate to page-2 directly using navigate, the same click on login button is working.

Any help would be highly appreciated. Please let me know what I m missing.