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?
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.
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: