Clicking certain area of an object on different screen sizes
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Clicking certain area of an object on different screen sizes
I am encountering an issue where an object is clickable (to bring up a menu) but only in the upper right hand corner of it. I cannot seem to map just the clickable area so when I do a test, I need to include coordinates of the object so that the correct area is clicked, thus opening the menu for additional items to be clicked.
This works fine for me but when run on a co-worker's computer the test fails because our screen sizes are different so the object is not clicked in the right location.
Is there a way around this?
Thanks!
Solved! Go to Solution.
- Labels:
-
Keyword Tests
-
Object Recognition
-
Recording
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes. Click by the object name instead of coordinates. You have just found out why coordinates are not particularly reliable.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This does not work for this scenario. Only clicking the top right of the object opens the menu. And we have found that having coordinates causes the test to fail on other screens since positioning is not the same.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Show us the detailed object spy results from that button please.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For object spy, we need the Advanced view please
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> I need to include coordinates of the object so that the correct area is clicked
Can you provide your code for this action?
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This particular test is keyword based but the underlying code is:
page.panelDevicecardcontainer.panelDevicedatacontainer.Click(144, 11); //works for me
When my coworker records the click action, he of course gets different coordinates:
//page.panelDevicecardcontainer.panelDevicedatacontainer.Click(111,6);
This doesn't work because the "object" to open the menu (see earlier screenshot) as the object seemingly needs to be clicked in top right only:
//page.panelDevicecardcontainer.panelDevicedatacontainer.Click();
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> page.panelDevicecardcontainer.panelDevicedatacontainer.Click(144, 11); //works for me
You may try to click, say 10 pixels left from the right edge of control and 5 pixels down from its top to hit the clickable area. Usually this works when test code is executed on systems with different screen resolutions. E.g.:
var pointX = page.panelDevicecardcontainer.panelDevicedatacontainer.Left + page.panelDevicecardcontainer.panelDevicedatacontainer.Width - 10;
var pointY = page.panelDevicecardcontainer.panelDevicedatacontainer.Top - 5;
page.panelDevicecardcontainer.panelDevicedatacontainer.Click(pointX, pointY); // clicks 10 pixels left from the right control's edge and 5 pixels down from the top
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
