WebPagetest Forums
How to test a website that requires a username and password to log in??? - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: Web Performance (/forumdisplay.php?fid=3)
+--- Forum: Discuss Test Results (/forumdisplay.php?fid=4)
+--- Thread: How to test a website that requires a username and password to log in??? (/showthread.php?tid=15828)



How to test a website that requires a username and password to log in??? - ChengJ - 07-04-2019 06:20 PM

Big GrinBig Grin
Hello!
I want to [/size]and jump to a sub-page after successful login, but I don't know how to write script statements. Can someone help me? Be deeply grateful.

Here's what I wrote:

navigate https://smartcity.baidu.com
setValue name=userName ******
setValue name=password ******
execAndWait $(document.getElementsByClassName('pass-button-submit')[0]).submit()
navigate https://smartcity.baidu.com/od/regionPortrait


RE: How to test a website that requires a username and password to log in??? - vincent - 07-10-2019 02:21 AM

If setValue doesn't work, try setting it using JS, its been more reliable in my testing