I'm running a web application in TestComplete. When I Run or Navigate to the url for the application, the application won't respond with the full page response until the user enters their credentials. The problem is that the Run method waits for a successful HTTP response before moving onto the next line of code, wherein said credentials are entered via script.

Eventually, the navigation will timeout and it will proceed executing the rest of the script (which runs fine). But this greatly delays the time it takes to execute a simple login test:

Timeout

I thought one solution might be to use the PageLoadWaitTime parameter on the Run Method. According to the documentation for Run, it takes an optional integer as the second parameter, but if I use the following syntax, the script no longer parses:

<!-- language: lang-vb -->
browser.Run("localhost", 2)

Screenshot

I've also followed the suggestion here and tried to cast to an integer type, but that doesn't work either:

<!-- language: lang-vb -->
Dim waitTime
waitTime = 2
waitTime = CInt(waitTime )
browser.Run("localhost", waitTime )

Any ideas on how to either:

  1. use VBScript in this instance to shorten the length wait time (slightly hackish)
  2. or how to better optimize the page so that it waits for a HTTP 401 Challenge instead of a successful HTTP 200 response.

In VBScript, when you enclose a procedure's argument list in parentheses, you must use the Call keyword:

Call browser.Run("localhost", 2)

If you omit the Call keyword, you must also drop the parentheses:

browser.Run "localhost", 2