Control the URL a qtp script accesses according to the test set it is run from.
Category:
Question ID: 104040
0
0

Can I control which URL and port my automated scripts access, by test set in Quality Center?

Marked as spam
Posted by (Questions: 4, Answers: 0)
Asked on February 5, 2010 8:48 pm
24 views
Answers (1)
1
Private answer

This example assumes that the Server and URL is the same regardless of the testset, but the ''port is variable based on a field on the testset entity in QC. It could be easily adapted to make ''server'', ''port'' and ''URL'' vary based on the testset as well, by adding other fields to the testset and retreiving their values and concatenating them into the ''FULL_URL'' at the end. This example utilizes the QCUtil object to retreive values from the testset where the test instance lives.

  1. Start by splitting the URL parameter into 3 parts:

    Server = myServerName
    URL = ''/myURL/myURLcontinued''
    PORT = ''7001''
    
  2. Create a new field on the test set called ''PORT''.

    (example shown below using ''CY_USER_01'' in the database)

  3. Then in the QTP script, retreive the value of PORT from the testset:

    set myCurrentTestSet= QCUtil.CurrentTestSet
    PORT = myCurrentTestSet.Field(''CY_USER_01'')
    
  4. Concatenate the peices into the variable FULL_URL:

    FULL_URL = ''http://'' & Server & '':'' & PORT & URL
    
Marked as spam
Posted by (Questions: 6, Answers: 167)
Answered on February 5, 2010 11:24 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top