Current time: 05-28-2020, 02:36 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script tests don't work well
02-18-2016, 04:36 PM
Post: #1
Script tests don't work well
We use script testing to test a page which needs sign in. The script looks like below. We add "waitForComplete" to make sure the test ends until the page rendering is complete. However, we still see some incomplete tests. Please find the attachment for screenshot.

The major issues are as below. I'm wondering if there's any log we can check what's happening during the test. Why are these data missing or incomplete?
1. No ranking after all tests are complete.
2. The test ends before the target page is rendering sometimes. So we'll see the homepage instead of the target page in the screenshot.

Code:
logData    0
//navigate to sign in page
navigate https://signin.ebay.com
//login    with your credentials
setValue    name=userid USERNAME
setValue    name=pass      PASSWORD
submitForm    name=SignInForm
waitForComplete
logData    1
//navigate    to testing page
navigate    https://xxx.ebay.com/xxx/xxx
waitForComplete

   
   
Find all posts by this user
Quote this message in a reply
02-18-2016, 06:51 PM (This post was last modified: 02-18-2016 06:52 PM by rviscomi.)
Post: #2
RE: Script tests don't work well
Check out this excerpt from Using WebPageTest that I contributed to the 2015 perf calendar: calendar.perfplanet.com/2015/using-webpagetest-authentication/

In short, try setting an authentication cookie instead of manually completing a log-in form. This way you can simply navigate to the authenticated page, which should greatly simplify the script and avoid strange behavior like you're seeing. The script would look something like this:

Code:
setCookie http://www.ebay.com session=286755fad04869ca523320acce0dc6a4
navigate http://www.ebay.com/

Simple, right?

One other note is that the documentation for waitForComplete lists only IE for browser support. However, you're testing in Chrome so it won't work the way you think it should. See https://sites.google.com/a/webpagetest.o...orComplete
Visit this user's website Find all posts by this user
Quote this message in a reply
02-19-2016, 11:00 AM
Post: #3
RE: Script tests don't work well
(02-18-2016 06:51 PM)rviscomi Wrote:  Check out this excerpt from Using WebPageTest that I contributed to the 2015 perf calendar: calendar.perfplanet.com/2015/using-webpagetest-authentication/

In short, try setting an authentication cookie instead of manually completing a log-in form. This way you can simply navigate to the authenticated page, which should greatly simplify the script and avoid strange behavior like you're seeing. The script would look something like this:

Code:
setCookie http://www.ebay.com session=286755fad04869ca523320acce0dc6a4
navigate http://www.ebay.com/

Simple, right?

One other note is that the documentation for waitForComplete lists only IE for browser support. However, you're testing in Chrome so it won't work the way you think it should. See https://sites.google.com/a/webpagetest.o...orComplete

Thanks for your reply. Actually, waitForComplete does some trick. If I don't add it, most of the tests will end before navigating to the target page. With it, I can see most of the tests can complete.

BTW, for such issues, do you have some logs we can check? for example, for the ranking data missing, etc.
Find all posts by this user
Quote this message in a reply
02-24-2016, 01:11 AM
Post: #4
RE: Script tests don't work well
If you need a manual delay, Sleep is probably a better option. "waitForComplete" waits for an explicit message from js on the page which I'm pretty sure ebay hasn't implemented.

When debugging, it tends to be easier to use "combineSteps" at the beginning and remove the logData 0/1 commands so you can see the full sequence that is being executed.

It also tends to be FAR easier to use the exec/execAndWait commands for manipulating login forms because you can test and debug it locally with dev tools console first, make sure it does what you expect it to and then use it as part of a test script.
Visit this user's website Find all posts by this user
Quote this message in a reply
02-25-2016, 02:26 AM
Post: #5
RE: Script tests don't work well
(02-24-2016 01:11 AM)pmeenan Wrote:  It also tends to be FAR easier to use the exec/execAndWait commands for manipulating login forms because you can test and debug it locally with dev tools console first, make sure it does what you expect it to and then use it as part of a test script.

Speaking of local testing, any change that some love for the scripting engine is planned in the future?
It's being used far more than it appears and it's became pretty invaluable to measure user journeys for example.
I know you're a very busy guy and believe if I had the knowledge to contribute to the project I would be already doing PR's along the lines of local test scripting with debugging or improve the documentation with some good examples of several use case scenarios.
As is, a lot of time is spent looking at empty invalid tests and go by trial and error.

Incidently, WPT is an epic undertaking which me and I'm sure every single person with performance on their radar will be eternally grateful to you for building such an essential and critical tool. So take my comments in stride, and keep up the amazing work you're doing.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)