0
votes

Firstly, I will give you some idea about what I am doing. I writing a few test cases without a framework, so for this I am creating a VBS file in which have written a code for launching of the UFT and opening of the action have created. Code is like this:

  Set qtApp= CreateObject("QuickTest.Application")
  qtApp.Launch
  qtApp.Visible = True
  Set qtTest = qtApp.Test
 'And then call your scripts one after another
  qtApp.Open "D:\UFT\TestScript\Function_Demo",true
  Set qtTest = qtApp.Test
  qtTest.Run

Also have created functions for each scenario which are associated with this Action, so whenever VBS file will be triggered by third system it will launch UFT and open the Action in which I am calling all the functions, so here comes my first question

  1. How can I set the priority of the function so that it will run in sequence?
  2. Also I wanted to write code for the result status as pass and fail and depending on the pass and fail status I wants to update the XML specific nodes with the status and also along with this wants to capture the screenshot of the test case whenever it's failed and for this also have to update the path in XML nodes. As I am very new to the UFT so was not sure how to do this can someone please help me with this? How to write the code and what all things will be required?

Quick response will be appreciated.

2
Your first query makes no sense - you should call the functions in the order you wish them to be executed, there's no "priority" assignment to apply. Your second query can be achieved, but we're not here just to write your code for you - you need to show what effort you have expended first, at which point we can help you with any problems.Dave
For the First Question, you may refer HerePranav
Hi Amit, Welcome and thanks for posting. I think it would help if you split the two questions in this post this post into two separate questions. as the questions do not not seem to be related.Dan
Hi Amit Baheti, while your getting started might want to consider launching the scripts from a batch fileDan

2 Answers

0
votes

Regarding Function Priority :-

  1. Function in Test Action always takes priority over any other function with same name in any other function libs.
  2. Second Priority is Function from Lib which is executed last[if u using loadfunctionlib or executefunctionlib]

Regarding XML specific nodes :-

Look for Res/Report/results.xml Summary Node
ex :- Summary sTime="*************" eTime="**************" passed="128" failed="2" warnings="36" /Summary

0
votes

Question 2: UFT provides a function to update the results:

Reporter.ReportEvent micPass, "Step 1", "This step has passed. The object was found"
Reporter.ReportEvent micFail, "Step 1", "This step has failed. The object was not found"

it also provides a function to store the screenshot of the enire desktop

Desktop.CaptureBitmap "C:\Temp\HP-UFT-Test.png",true
Reporter.ReportEvent micFail, "Step", msg, "C:\Temp\HP-UFT-Test.png"

Its also possible to capture a screenshot of specific, objects for instance:

WpfWindow("SAP Work Manager").CaptureBitmap "C:\Temp\HP-UFT-Test.png",true 
Reporter.ReportEvent micFail, "Step", msg, "C:\Temp\HP-UFT-Test.png"