Micro Focus QTP (UFT) Forums
Why Run time erro is displaying while i am usning copy of action Option? - 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: Why Run time erro is displaying while i am usning copy of action Option? (/Thread-Why-Run-time-erro-is-displaying-while-i-am-usning-copy-of-action-Option)



Why Run time erro is displaying while i am usning copy of action Option? - njnirmal - 08-12-2009

Hi..
there is one problem in my script.. I am getting one runtime error While i am trying to use the copy of action function . take a example of flight Reservation . I have created seprated action name as" Login" This action is not a reusable . While i used this action using Insert--> call to copy action
and run the script .. Error message is displaying .
I am enclosing the snaps . Kindly find the attached snaps . and help me out.
Why this problem is appearing ?


RE: Why Run time erro is displaying while i am usning copy of action Option? - basanth27 - 08-12-2009

Check the below,

1. Repository association to the action ?
2. From the OR select the object "Agent" and highlight it in the application.
3. Place a breakpoint and debug to see where exactly and why it causes the error.

Let me know the outcome.

Warm Regards,
basanth


RE: Why Run time erro is displaying while i am usning copy of action Option? - Saket - 08-12-2009

Also Check if your application is running and should be at Login before run.
Or you can insert a statement to launch the application in the login action reusable.
i beleive you have not started the application before execution of your test, thats why the error is there


RE: Why Run time erro is displaying while i am usning copy of action Option? - njnirmal - 08-12-2009

Hi..........
I didn't get it ? can u expalin me clearly.. why is happing ?


RE: Why Run time erro is displaying while i am usning copy of action Option? - Saket - 08-12-2009

Hi nj,

the first thing can you tell us - have you started the application before runing your script?

In your script, you see the error occurs at very step where you are setting agent name.
Error occurs as object's parent is missing i.e Login dialog. that means QTP is not able to find the application under test.

So you will have to launch the application first and then start execution.

Hope this will help you to understand.


RE: Why Run time erro is displaying while i am usning copy of action Option? - basanth27 - 08-12-2009

Blistering Barnacles...Okay...Here you go,

@Saket - please dont mind, i am going to merge your answers with mine because they seem very much basic verification which definitely needs to be done before we begin.

Check the below before you begin the execution,

1. Have you opened the application ??
2. Was the application opened before QTP or after QTP ? If you are confused and not sure then, Close QTP and the application, Open QTP first and then the Application.
3. Where have you added the objects to the repository ? Is it local or Shared ? If local dont bother at all. if shared, Right click on the action, navigate to Action->Action Properties and then Associate repositories. Verify if the Shared Repository is associated to the action your code is in.

Execution :

1. Start the execution.
2. If you get the same error, Stop the execution. Go to the Object Repository Manager, open your repository, Select the Object and then click on the option Highlight in the application. Does it highlight ?
If yes, Then come back to your script place a breakpoint before the line it errors out.

Start the execution again, and at the breakpoint begin debugging.Check how the application behaviour is at the moment of error.

Let us know if this helped you.


RE: Why Run time erro is displaying while i am usning copy of action Option? - Saket - 08-12-2009

No problem Basanth, afterall we are doing the same
this was great, good job done
Hope NJ is will get it clearly now


RE: Why Run time erro is displaying while i am usning copy of action Option? - njnirmal - 08-13-2009

ya .. thanks both of You. You expalined me very clearly..