Current time: 12-04-2020, 03:40 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting - How to increase timeout for a specific step
11-04-2015, 04:18 PM
Post: #1
Scripting - How to increase timeout for a specific step
I have script like below. First, it navigates to a page which will redirect to sign in page. After sign in, it should redirect back to this page. Sometimes, it takes long after submitForm step. Then the test is ended and doesn't catch the target page. Sometimes it works well. So the problem is the network timeout in the step "submitForm". I tried adding "setTimeout 10" after "submitForm name=SignInForm". But it doesn't work well. And per the documentation, the timeout is in seconds. However, it will wait for very long even I set it to 2. So I'm not sure how to set such a timeout. I also tried "sleep" and "waitForComplete" but they are not working either. What I need is to have it wait until the submitForm step completes successfully. Anyone can help me out?


logData 1
//Navigate to a page which needs sign in and redirect to sign in page
navigate http://www.xxx.com/aaa/bbb

//sign in
setValue name=userid xxxxx
setValue name=password xxxxx
submitForm name=SignInForm

// Question: How to increase timeout for the step "SubmitForm"?

// After sign in, it should redirect to the original page
Find all posts by this user
Quote this message in a reply
11-10-2015, 11:10 AM
Post: #2
RE: Scripting - How to increase timeout for a specific step
Anyone can help? Thanks a lot!
Find all posts by this user
Quote this message in a reply
11-11-2015, 01:43 AM
Post: #3
RE: Scripting - How to increase timeout for a specific step
(11-10-2015 11:10 AM)sally Wrote:  Anyone can help? Thanks a lot!

Have you tried setActivityTimeout?
Find all posts by this user
Quote this message in a reply
11-17-2015, 04:01 PM
Post: #4
RE: Scripting - How to increase timeout for a specific step
(11-11-2015 01:43 AM)arollest1 Wrote:  
(11-10-2015 11:10 AM)sally Wrote:  Anyone can help? Thanks a lot!

Have you tried setActivityTimeout?

Thanks. But it doesn't work.
Find all posts by this user
Quote this message in a reply
12-10-2015, 09:16 AM
Post: #5
RE: Scripting - How to increase timeout for a specific step
Can confirm. Changing the activityTimeout doesn't affect the login. execAndWait or submitForm does not wait for login to complete and stops the test before the page redirect is completed.
Find all posts by this user
Quote this message in a reply
12-29-2015, 04:13 PM
Post: #6
RE: Scripting - How to increase timeout for a specific step
I recently submitted a post to the Perf Planet blog about authentication that I think is relevant here. See http://calendar.perfplanet.com/2015/usin...tication/.

You appear to be using the DOM manipulation approach with a single navigation command. Besides the brokenness you described, this will also result in polluting the results with the overhead of signing in. The way to exclude this kind of bootstrapping is to use `logData 0` to ignore requests as you do some scripting, then enable logging before navigating to the actual test page. Relying on the redirection instead of explicitly navigating is likely to be your issue.

Alternatively, you should consider the other approach mentioned in the post which is to set an auth cookie directly. This enables you to test the page without any login bootstrapping. You just pass in the preauthenticated session cookie so you can hit the test page without getting bounced. The script to do that is simply:

setCookie http://www.example.com session=286755fad04869ca523320acce0dc6a4
navigate http://www.example.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


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