Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
A_N_D Regular Contributor.
Regular Contributor.
328 views

Passing parameters from Quality center to UFT API test script - not working anymore

HI,

i have some API scripts that needs to be run on different environments, like QA, UAT, Production etc. i am unable to figure out an easy way to set this up in Quality Center, so i can run them for any environment i like.

In my API Script, i have added an Input paramter for the url and have used that as a data source for the APi call.

For QC, i looked online and the suggestion was to set this within the execution settings for the script in Test Lab. i did that, passing an actual value and it worked the first time. i was able to run all my scripts.

I now have a new iteration and am trying to do the same, but the Actual value is not being passed. Infact within execution settings for test script, if i add the actual value data and click Ok, and open the test again i notice that the data wasnt saved.

i am not sure why it had worked earlier, but does not anymore. i have spent a few days trying to make this work

can anyone please help me? or let me knwow if there is an easier way to set this up, so i can run the scripts for any environment during the SLDC phase.

Any help is highly appreciated!!!

Thanks!!

0 Likes
4 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Passing parameters from Quality center to UFT API test script - not working anymore

Hi,

Can you give us more details about you environment?

UFT version, ALM version, Type of WebService, etc.

Also can you please give us more details on did you make this work earlier? Also, you mention that this doesn't work with a new interaction, does that mean that doesn't work on specific situations?

Looking forward to your response.
Kind Regards,
 
 
0 Likes
A_N_D Regular Contributor.
Regular Contributor.

Re: Passing parameters from Quality center to UFT API test script - not working anymore

Hi,

We are on Quality center 12.20 and UFT 14.5. My Api returns JSON , and i created REST service method in my script.

We are testing in the QA environment at present. So for my scrpt for the Start action, i added an input parameter with the QA url as the default value.

In QC - when i view the test, i can see the parameter under the Parameter tab. i can see the default value.

I then created a test set in the Test Lab folder and added the test case above. I clicked on the test name, navigated to the Execution Settings and entered the url in the Actual value field. I clicked Ok to save the value and then hit Run.  the test script ran without issues. Url value was passed to my UFT API script and it passed the testing.

I now have a new release within the QA environment. So i created a new folder under test lab for the new release cycle i am testing. and tried to repeat the steps above., clicking on the test name and then opening Execution settings to enter the actual value. but after i click ok, it doesnt save this data and when i run the script no url is passed to UFT. i am not sure what happened, i didnt do anything different, but it just doesnt work anymore. i can still see the Parameter and its default value.

What i am looking to achieve is to parameterize the url, so i can pass it through QC when i want to run the test case. The same test case will be run against QA, UAT and Production and the url for each will be different. 

i had also tried using the Environment varaibale within the UFT API test script and creating profiles for QA, UAT etc with different urls. but then i realized i would need to go into each script and change the profile when i want to run it against a new environment.

I am sure there must be an easier way of doing this. i just want to be able to run my test scripts in QA, UAT or production and be able to supply the url for these environments from QC.

Highly appreciate any help!!!

Thanks

AD

 

0 Likes
Jason Xu Trusted Contributor.
Trusted Contributor.

Re: Passing parameters from Quality center to UFT API test script - not working anymore

Hello AD,

From your description, I understand that you couldn't receive an input parameter from ALM for API test script. I also tried with several different versions of ALM and UFT. Howevere, I still cannot reproduce the issue.

It looks irrelevant to whatever activity that you're trying to use in the API test. I suggest we use a simpler case, for example, input a number and do a simple calculation inside the API test, for a quick attempt to reproduce and identify the problem.

If it's still not working, I suggest you open a ticket and our support team will take care of it.

Thanks,

Jason

 

0 Likes
A_N_D Regular Contributor.
Regular Contributor.

Re: Passing parameters from Quality center to UFT API test script - not working anymore

Hi Jason,

I found some information online and tried to redo the input paramter in my script.

here are the steps i used and now it does pass the parameter from ALM to UFT. But now i get errors in QC - The Key was already present in the dictionary Parameter name: key.

I am not sure if i followed the correct steps, though my script runs fine in UFT and also form QC. i get the error popups but can click ok (3 times) to continue to the next one.

What i did to be able to pass value to UFT.

Within UFT script-

1. Added a new excel file to data tab with the Input parameter name and value. i only have 1 column with the URL info.

2.  I ensured to select the Allow other tools to override the data option for the above.

3. I used this parameter for the REST Service URL field. Saved the script in UFT.

Within QC -

1. I added a new Datatable under Test Resource and uploaded the same excel sheet as used above

2. In the Test Plan module, for the test script >Parameters tab - i selected the datasource>chose the data table from step 1 and mapped the Resource paramter to the test paramter.

3. Used the Test configuration tab >details and i opened data tab - selected the datasource as the datatable created and checked the option Override test data source box.

Saved all the information. I did the same for all my scripts - i have about 20 of them.

Now when  i try to run them from Test Lab, i get an error

It works fine and i dont get any errors if i only call 1 script. but if i call and run another script i start getting the error below

The Key was already present in the dictionary Parameter name: key.

i am unsure what i am doing wrong. The value is sent from QC to UFT, but cant i use the same datatable for all my scripts? i do notice that the run results and log file only gets generated for the first script and is not doing it for consecutive ones, not sure if thats the issue?

Any help is appreciated. Its my first time data driving the scripts from QC and i am probably missing something in my steps. But its critical path now, as i cant run them from QC (though i can still directly run them from within UFT)

Thanks

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.