5

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.

Nick L
  • 281
  • 1
  • 6
  • 18
  • I think a little more information is required to offer much assistance I'm afraid. I've never attempted to get the results into ALM myself. A very basic question that I'm sure you've tried, but do you actually have permissions to put that type of file in the location you're talking about? Just to clarify also, is UFT running on the same box as ALM? DO you have any cleanup scripts? I remember people whacking loads of results files into our SVN when checking in tests, perhaps someone put in a script to remove these at the end of test runs? – shicky Dec 18 '14 at 11:19
  • I'm doing everything at a local level right now. I have tried saving to several different locations to see if the location makes any difference, but nothing has worked. There are not any cleanup scripts. I'm working at the simplest level right now and then going to extend once I get things working locally. I'm not sure what you mean by UFT running on the same box. – Nick L Dec 19 '14 at 15:16

2 Answers2

2

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.

shicky
  • 2,076
  • 5
  • 30
  • 44
  • My main goal is to eliminate the need for a human going into UFT and executing. UFT works just fine. I've edited my post to clear up my motives a little bit. – Nick L Dec 19 '14 at 16:50
  • So to be clear, running the tests are your problem, or putting the run results where you want them is the problem? As far as I understand what you've said the tests element is fine as CI takes care of overnight runs. You want to come in and view the results in a convenient location? If so, the above achieves that – shicky Dec 19 '14 at 17:07
  • Please forgive me, I saw "opened up UFT" and thought that you meant do this every time, and as a result, just skimmed over the rest thinking that you didn't understand what I was looking for. I did as you mentioned and it worked like a charm. I apologize; however, I do appreciate your detailed response! – Nick L Dec 19 '14 at 17:41
  • No worries Nick, just glad you got it sorted in the end! It can be very frustrating when a minor configuration issue is to blame! Believe me I've been there.. – shicky Dec 19 '14 at 17:44
  • It is to my knowledge that UFT produces a Results.xml first, applies a transformation, and then displays the html or pdf. Do you know how I can get that original Results.xml? I would like to apply my own transformation to get that results.xml into JUnit format. – Nick L Dec 19 '14 at 18:51
  • Hi Nick, if you're talking about from the run settings then I'm afraid I'm not sure, I have no experience of this. For a single test you should be able to define an output path and the results.xml will be part of that. – shicky Dec 23 '14 at 12:28
0

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.

Nick L
  • 281
  • 1
  • 6
  • 18