Micro Focus QTP (UFT) Forums
Run Error: Cannot find Object's parent - 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 Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Run Error: Cannot find Object's parent (/Thread-Run-Error-Cannot-find-Object-s-parent)



Run Error: Cannot find Object's parent - anupam4j - 09-17-2012

Hi,

I have recorded a simple script in QTP.
It replays for the first time but stops midway the second time I run it with an error. Please refer to the attachment for the error.
I am using IE7 and QTP 11.00 .

Below is the script.


Code:
Browser("Google").Page("Google").WebEdit("q").Set "QTP"
Browser("Google").Page("Google").WebButton("Google Search").Click
Browser("QTP - Google Search").Page("QTP - Google Search").Link("HP QuickTest Professional").Click
Browser("HP QuickTest Professional").Page("HP QuickTest Professional").Sync
Browser("HP QuickTest Professional").Close

Please help.


RE: Run Error: Cannot find Object's parent - sshukla12 - 09-17-2012

Hi,

Just make sure u start running ur script every time google.co.in is open not on the page on which u already performed the action or on which script has run.USe systemutil.run "www.google.co.in" at the start of ur script.

Regards,
Sankalp


RE: Run Error: Cannot find Object's parent - anupam4j - 09-17-2012

Thanks a lot for the quick response. Really appreciate.
I rerecorded the script with changed "Record and Run settings" ("Record and run test on any open browser"). Now I am launching IE for each run as per your suggestion and it is working.
The script is :

Code:
SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe","","H:\","open"
Browser("Google").Page("Google").WebEdit("q").Set "QTP"
Browser("Google").Page("Google").WebButton("Google Search").Click
Browser("QTP - Google Search").Page("QTP - Google Search").Link("HP QuickTest Professional").Click
Browser("HP QuickTest Professional").Page("HP QuickTest Professional").Sync
Browser("HP QuickTest Professional").Close

But now whats happening is that the scripts running fine if theres a 15 to 20 secs gap between any two successive runs but it stops if the time gap is small.


NOTE: With systemutil.run "www.google.co.in" its not running.

Is there any workaround for this.


RE: Run Error: Cannot find Object's parent - sshukla12 - 09-18-2012

Time required between execution of two steps can be set under setting.
Go through qtp help file for more info.

Regards,
Sankalp