Micro Focus QTP (UFT) Forums
script for clicking an image in QTP - 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: script for clicking an image in QTP (/Thread-script-for-clicking-an-image-in-QTP)

Pages: 1 2


script for clicking an image in QTP - Bala Preetha33 - 10-05-2010

Hi all

I am trying to clicking an image called "End of Record". After writing a script for this function, if i run this script. It shows an error msg as " [COLOR="red"]The End of record object was not found in the Object Repository.
Check the Object Repository to confirm that the object exists or to find the correct name for the object.[/COLOR]"
My code is,
Code:
strBrowser="title:=ECShipLite"
Browser(strBrowser).Page(strBrowser).Image("name:=End of Record").Click
Plz can any one help me to solve tis problem. Thanks in advance.

Cheers,
preetha Wink


RE: script for clicking an image in QTP - supputuri - 10-05-2010

Hi Preetha,

YOu can debug the issue by checking the object property in RunTime. Place a brakepoint @ the step where you want to click on the End of record, then spy the object and cross check the object properties with the OR properties.

Let me know if you need any help.


RE: script for clicking an image in QTP - Bala Preetha - 10-06-2010

Hi

I tried using the debug. Still it showing the same message. But in OR the object is exist. Now what shall i do to solve this problem?
I used this code to check whether it finds the object or not,
Code:
strBrowser="title:=xxx"
If Browser(strBrowser).Page(strBrowser).Image("name:=End of Record").Exist(1) Then
    Print "Image found"
    Browser(strBrowser).Page(strBrowser).Image("name:=End of Record").Click
    Else If not Browser(strBrowser).Page(strBrowser).Image("name:=End of Record").Exist(1) Then
    Print "Image not found"
    End If
    End If

It prints that "Image not found".
Cheers,
Preetha.


RE: script for clicking an image in QTP - jsknight1969 - 10-07-2010

It's name only exist in the OR not on the page. You can not use the name property in DP, unless there is a name tag on the object, because it ignores the OR. Try using html id or some other description. That should work.


RE: script for clicking an image in QTP - A.Saini - 10-07-2010

Hi Preetha,

Try set of properties of Image to identify it.Sometimes one property is not sufficient to identify the object.

Use some other properties like html id, innertext etc.....

Hope it will work .....

Smile


RE: script for clicking an image in QTP - Bala Preetha33 - 10-15-2010

Hi
For that objet there is no Html id and innertext property. So i used webtable and Image type properties . It showing the same error. It cant able to identify the object. can u plz say me how to solve this problem.
Thanks in advance.

Regards,
Preetha.


RE: script for clicking an image in QTP - jsknight1969 - 10-16-2010

You can use any property on the img tag. Try alt or source (if its unique). if it's not unique, you can still use it but you will need an index property as well.


RE: script for clicking an image in QTP - KavitaPriyaCR - 10-19-2010

Hi Preetha, Is this issue solved?


RE: script for clicking an image in QTP - Cassin - 10-19-2010

I have similar issues many times. Often I have found that while the Object exists in the Repository and I am selecting the correct values for the DP that it still is not working.

I have found that this is most often because I am missing a level, sometimes the record is not capturing deep enough. More specifically, some of my images and fields are not only in the browser and on the page, but also in a frame, inside of a table. In this case -- I am needing to go back and add the frame information and the table information that is listed in the object spy.

Perhaps you are having a similar issue. (This is my main reason for getting this error and similar errors.)

I hope this helps.


RE: script for clicking an image in QTP - vinod123 - 01-02-2012

Try this

Code:
Browser("micclass:=Browser").Page("micclass:=Page").Image("file name:=[b]name of the image file.extension[/b]").click