2
votes

QTP is recording an object with class as image but while running not able to identify and click the image in a web application but passing the step without any action on application.Please let me know what might be the reason.

2
This is unanswerable until you provide more information. I suggest you add the following to your question: the object identifiers that you are using to try and interact with the Image, and a snippet of the HTML surrounding and containing the image element itself. You might also want to mention what error handling settings you are using and/or whether you are using "on error resume next". stackoverflow.com/help/how-to-ask - Xiaofu

2 Answers

0
votes

Try using descriptive programming to create this object and click. If you are running QTP 11.0 or higher, try visual identifier.

0
votes

Worst case scenario if nothin works you can use descriptive programming to find the abs_x & abs_y of the image and then use DeviceReplay Object & MouseClick method to click on the image. eg.

x_coord = Browser("name:=.*").Page("title:=.*").Image("name:=Image_Name",").GetROProperty("abs_x")
y_coord = Browser("name:=.*").Page("title:=.*").Image("name:=Image_Name",").GetROProperty("abs_y")
    'USE DEVICEREPLAY OBJECT TO CLICK ON IMAGE LINK BASED ON X-COORDINATE & Y-COORDINATE
    Set dr = CreateObject("Mercury.DeviceReplay")
    dr.MouseClick x_coord, y_coord, 1