Can’t click on arrow object with QTP
Question ID: 105528
0
0

I’ve got a little arrow object next to a field that is seen as a WebElement. I can click the field, but I can’t get QTP to see/recognize the arrow down button to the right of the field and I need to click it.

Marked as spam
Posted by (Questions: 227, Answers: 22)
Asked on July 28, 2014 1:16 pm
82 views
Answers (2)
0
Private answer

I tried the suggestion and it seems to work. I'm having a little 'hit or miss' getting the exact click correct, but I just need to play around with the offset and it should be okay.

Marked as spam
Posted by (Questions: 227, Answers: 22)
Answered on July 28, 2014 3:08 pm
2
Private answer

You might try using GetROProperty to grab the coordinates of the object next to the arrow object and then use those to execute a modified Click method on the object. This would make the script flexible with the object if it moves around or you can't use any other method (descriptive programming, RegExp, etc.)

Example:

'This gets the coordinates of the object next to the arrow object. These coordinates relate to the whole screen, not the frame. We will use this with the DeviceReplay

myObjX = Browser(''BrowserJunk'').Page(''JunkPage'').WebElement(''JunkElement'').GetROProperty(''abs_x'')
myObjY = Browser(''BrowserJunk'').Page(''JunkPage'').WebElement(''JunkElement'').GetROProperty(''abs_y'')

'Instantiate the DeviceReplay object

Set devReplay = CreateObject(''Mercury.DeviceReplay'')

'Add an offset value to the x coordinate (this might take some trial and error) and then click on those coordinates

devReplay.MouseClick myObjX, myObjY, 2

Set devReplay = Nothing

Marked as spam
Posted by (Questions: 2, Answers: 477)
Answered on July 28, 2014 1:17 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top