1 year ago
#388676
Metazoxan
Clicking check boxes based on text with Eggplant
I am trying to create a generic handler for selecting a checkbox. But by Generic I mean it’s able to pick it based on the next next to the check box. Like a row of check boxes that say “Option 1, option 2 , Option 3” with the checkbox a little to the left of the text and the three options placed in a column.
The below code errors imagefound Error - Invalid Rectangle: MySearchRect (its saying it either cant find the rectangle or the coordinates are not right or not valid To handle SelectBox
params Check_Name
Set SearchRectangle to my QueryPaneSRC
set the TextLocation to ImageRectangle (text:(Check_Name))
set Check_Name to (left to TextLocation – 35, right of TextLocation, top of TextLocation – 3, right of the RemoteScreenRectangle, the bottom of TextLocation + 2)
put MySearchRect
If ImageFound(ImageName:”Images/Box_UNCHECKED”, searchRectangle: MySearchRect
Then
Click FoundImageLocation()
Return Else
ImageFound(ImageName:”Images/Box_CHECKED”, searchRectangle: MySearchRect
Return End if
End SelectBox
Run SelectBox ”Option 1”
automation
automated-tests
eggplant
0 Answers
Your Answer