Welcome, Guest. Please login or register.
Login with username, password and session length

 
Advanced search

18488 Posts in 4838 Topics- by 32654 Members - Latest Member: revitvm
 

AdvancedQTP forums have been nominated as a finalist in ATI’s 2nd annual automation honors awards!

We’d like to thank you for your continued support and participation, and urge you to hurry and vote.

Make you voice count! 


Pages: [1] 2   Go Down
Print
0 Members and 1 Guest are viewing this topic.
Author Topic: the server threw an exception    (Read 483 times)
Frank Mayer
User
*
Offline Offline

Posts: 8


« on: March 11, 2010, 06:55:04 AM »

Attempting to execute QTP through a DOS window using cscript with the following vbs

Dim qtApp          'As QuickTest.Application
              'Declare the Application object variable
Dim qtTest              'As QuickTest.Test
         'Declare a Test object variable
Dim qtResultsOpt       'Declare a Run Results Options object variable
Set qtApp = CreateObject("QuickTest.Application")
         'Create the Application object
qtApp.Launch      'Start QuickTest
qtApp.Visible = True    'Make the QuickTest application visible
qtApp.Open "C:\JMSC QTP Automation\CheckURL", True
         'Open the test in read-only mode
         'set run settings for the test
Set qtTest = qtApp.Test
qtTest.Run       'Run the test
WScript.StdOut.Write "Status is: " & qtTest.LastRunResults.Status
         'Check the results of the test run
qtTest.Close       'Close the test
qtApp.quit      'Close QuickTest Pro
Set qtResultsOpt = Nothing    'Release the Run Results Options object
Set qtTest = Nothing    'Release the Test object
Set qtApp = Nothing    'Release the Application object

The actual DOS commend is “cscript //nologo checkurl.vbs”

The function works and does exactly what I want it to do.  But inconsistently I receive the error “checkurl(8, 1) (null): The server threw an exception.” Since this application will be in a production environment, this is an unacceptable return from QTP.  Here is what I do know; sometime the vb script works.  The actual QTP scripts simply validates that a series of URLs exist.  The license and environment are configured correctly.
Has anyone seen this error before and can help to eliminate the issue?





Logged
Asiq Ahamed
Moderator
Advanced User
*****
Offline Offline

Posts: 501



« Reply #1 on: March 11, 2010, 07:45:18 AM »

Hi Frank,
       I am not sure why you are getting "The server threw an exception" error. Ok create a bat file with below code and run the bat file in DOS.

Please confirm, if you get the error again.

Code:
cscript "C:\Library1.VBS"
Logged
Tarun Lalwani
Advanced User
*****
Offline Offline

Posts: 886



WWW
« Reply #2 on: March 11, 2010, 08:12:27 AM »

Are you launching this vbs continuously?
Logged

Tarun Lalwani,
QuickTest Professional Unplugged - My new Book on QTP...
Frank Mayer
User
*
Offline Offline

Posts: 8


« Reply #3 on: March 11, 2010, 09:06:44 AM »

Hi Frank,
       I am not sure why you are getting "The server threw an exception" error. Ok create a bat file with below code and run the bat file in DOS.

Please confirm, if you get the error again.

Code:
cscript "C:\Library1.VBS"

Good Morning,
May I ask what is "C:\Library1.VBS"?

Here is a bat file that I am working on executing

Code:

set LSERVRC = c:\program files\common files\mercury interactive\license manager\lservrc
set LSHOST = 10.30.18.227
path = %path%;c:\program files\hp\quicktest professional\bin
cscript //nologo checkurl.vbs

Logged
Frank Mayer
User
*
Offline Offline

Posts: 8


« Reply #4 on: March 11, 2010, 09:10:41 AM »

Are you launching this vbs continuously?

Hi,
This is QTP script is to be run every time a new release of an application is install to confirm all URL pages are available.  There is a build process that a .bat file will be included in.  I don't think this exception error is going to fly with management.
frank
Logged
Asiq Ahamed
Moderator
Advanced User
*****
Offline Offline

Posts: 501



« Reply #5 on: March 11, 2010, 10:28:56 AM »

Hi Frank,
        I thought you are running the vbs in local.

OK write your bat file with ping path command,

Code:
set LSERVRC = c:\program files\common files\mercury interactive\license manager\lservrc
set LSHOST = 10.30.18.227
Pingpath 10.30.18.227
path = %path%;c:\program files\hp\quicktest professional\bin
cscript //nologo checkurl.vbs

See if this helps.
Logged
Frank Mayer
User
*
Offline Offline

Posts: 8


« Reply #6 on: March 11, 2010, 10:39:19 AM »

Hi Frank,
        I thought you are running the vbs in local.

OK write your bat file with ping path command,

Code:
set LSERVRC = c:\program files\common files\mercury interactive\license manager\lservrc
set LSHOST = 10.30.18.227
Pingpath 10.30.18.227
path = %path%;c:\program files\hp\quicktest professional\bin
cscript //nologo checkurl.vbs

See if this helps.


Help me out here, pingpath?  I don't think there is a DOS command like that.  Ping <ip address> will return 4 replies with times and lengths.  I will try the ping command.
Logged
Asiq Ahamed
Moderator
Advanced User
*****
Offline Offline

Posts: 501



« Reply #7 on: March 11, 2010, 10:44:03 AM »

Hi Frank,
         Sorry for the typo.

Code:
pathping 10.30.18.227

http://en.wikipedia.org/wiki/PathPing
Logged
Frank Mayer
User
*
Offline Offline

Posts: 8


« Reply #8 on: March 11, 2010, 10:44:37 AM »


Help me out here, pingpath?  I don't think there is a DOS command like that.  Ping <ip address> will return 4 replies with times and lengths.  I will try the ping command.

It did not work successfully.  However the return was "checkurl.vbs(8,1) (null):The server threw an exception"  That is a different return code, but I don't know where to go to locate what (8,1) might mean.

With the pathping command the results were exactly as above.  I am beside myself.

« Last Edit: March 11, 2010, 10:50:22 AM by Frank Mayer » Logged
Asiq Ahamed
Moderator
Advanced User
*****
Offline Offline

Posts: 501



« Reply #9 on: March 11, 2010, 11:21:01 AM »

Hi Frank,
      If you are not OK with bat file, then please try to switch over to PsExec utility.

I guess it may solve your problem.

http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

Good Luck Smiley
Logged
Manish Bhalshankar
User
*
Offline Offline

Posts: 42


« Reply #10 on: March 11, 2010, 09:58:17 PM »

Hi Frank,
Have you checked if all the URL's you are validating work fine when checked manually?
Logged

Regards,
Manish
Frank Mayer
User
*
Offline Offline

Posts: 8


« Reply #11 on: March 12, 2010, 05:32:07 AM »

Yes, but I can not even reach the first part of the script which closes all occurances of IE.  Have you seen this problem in the past?
Logged
Manish Bhalshankar
User
*
Offline Offline

Posts: 42


« Reply #12 on: March 12, 2010, 06:39:05 AM »

I am awear of one such error:
Quote
The remote server machine does not exist of is unavailable
and this happens when the QTPAutomationAgent.exe is terminated.
Logged

Regards,
Manish
Frank Mayer
User
*
Offline Offline

Posts: 8


« Reply #13 on: March 12, 2010, 09:29:44 AM »

What else can I try?  How can I end QTPAutomationAgent.exe safely so it can be re-executed? 
Logged
Manish Bhalshankar
User
*
Offline Offline

Posts: 42


« Reply #14 on: March 14, 2010, 10:30:13 PM »

You dont have to end
Quote
QTPAutomationAgent.exe.
If you do that you will get the error. You will have to keep this process running.
Logged

Regards,
Manish
Pages: [1] 2   Go Up
Print
Jump to: