Micro Focus QTP (UFT) Forums
QTP runs action More than once - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: QTP runs action More than once (/Thread-QTP-runs-action-More-than-once)



QTP runs action More than once - uma87 - 03-26-2012

Hi all,

Please help me with below issue.

I Have a QTP Script with 3 Actions called into main Action . All the three are Internal Actions.

The script goes this way....

Code:
DataTable.Import ("\\wax-qms-qc\Test-Automation\ABCURL.xls")
URL = Datatable.Value("URL",dtGlobalSheet)
Systemutil.Run  "iexplore.exe",URL

RunAction "Action 1", oneIteration

RunAction "Action 2", oneIteration

RunAction "Action 3", oneIteration

Some test Script......

Browser("").close.


The test ends with Closing the browser. QTP Runs fine till Browser().Close and again start to run only Action 3. In Action 3 it doesnt find the required Objects and Fails.

I Have Datatable Iterations set as "Run One iteration Only" and also in excel sheet only one URL is being used.

I want QTP to run only till Browser Close without going to Actions Again.
What do i need to do for this?


RE: QTP runs action More than once - sshukla12 - 03-26-2012

Hi,

Could u please check these:
1) File->Setting->Run : Run one iteration.
2)Action call properties(by right clicking on action)->Run : Run one iteration.

Regards,
Sankalp


RE: QTP runs action More than once - uma87 - 03-26-2012

Hi Sankalp,

Both have been set to Run one Iteration. This did not help. Any other workaround?


RE: QTP runs action More than once - sshukla12 - 03-26-2012

Hi,

For workaround u can use Exit Test() function but please check if u r using any loop or something else which is calling action 3 again.
Please debug the script at that point to check why it is navigating again to action 3.

Regards,
Sankalp


RE: QTP runs action More than once - uma87 - 03-26-2012

I'll Use Exit test () at the end of the script and give a try. I tried to debug, After the last step Browser.close, it directly goes to Action 3 Line 1 just as it goes to next step with out any error or message or information .




RE: QTP runs action More than once - sshukla12 - 03-26-2012

Hi,
Please re check action 3, action call properties->run
Its definitely be the issue with calling action.

Regards,
Sankalp