Nick L
Nick L

Reputation: 371

Running QTP test from VBScript - Not Saving Results to named location

I'm currently trying to run some QTP/UFT test scripts that are saved on our company's ALM server from a VBScript. I am doing this because I want these scripts to get run from our continuous integration server and our current CI server does NOT have a mechanism for executing QTP scripts similar to the HP-ALM addin for Jenkins. I am able to save the results and view them when I open up UFT and run the scripts, but this does not solve my current problem because then I have to manually open up the script and run it. I'm trying to eliminate the overhead of manual kicking off scripts when a continuous integration server can do it for me. I am setting my results location by

Set qtpResultsOptions = CreateObject("QuickTest.RunResultsOptions")
qtpResultsOptions.ResultsLocation = "C:\Path\To\Save\Folder"
test.Run qtpResultsOptions

However, nothing gets saved there. To make matters even stranger, if the "Folder" is already present, it runs the test and then that folder is removed, but it doesn't go to the Recycle Bin. However, if I specify the results location as C:\Path\To\Save\Folder\Results.xml then it retains that folder, but doesn't save anything there. I will likely have to clear things after this post, but the behavior is bizarre and I don't have any idea what to do.

Upvotes: 5

Views: 4919

Answers (2)

Nick L
Nick L

Reputation: 371

For anybody else that may look at this post:

Set qtpResultsOptions = CreateObject("QuickTest.RunResultsOptions")
qtpResultsOptions.ResultsLocation = "C:\Path\To\Save\Folder"
test.Run qtpResultsOptions

will save the results.xml (and everything else that QTP saves) to "C:\Path\To\Save\Folder" as long as that path is not on your desktop. After putting the project down for a couple of months, I picked back up and realized that it would save to places other than the desktop which is where I was saving to for convenience in testing whether or not my script worked.

Upvotes: 0

shicky
shicky

Reputation: 2126

I really do feel you need to edit your original question to include MUCH more information, for me there are a lot of moving parts and questions I'd want answered to be sure I'm answering the question.

But for now as you're working locally, how about we take things to a simpler level, you're working from a script, why?

I just jumped onto UFT and was able to get it to export the run results anywhere I wanted. I did this buy going to:

Tools -> Options -> General -> Run Sessions

You should now be faced with this screen:

configure

Make sure you tick the automatically export run results when run session ends checkbox and click on Configure...

You should now be faced with the following screen:

export

Just define your export location and set it up how you want it, does this work? For me it worked locally and also when exporting across the domain to another machine.

Upvotes: 2

Related Questions