17-04-23 05:15 PM
I have built an object that uses a web application. In this object, the script searches for the location of an element and uses the X and Y to do a Click Window action on the general Win32-page.
This worked really well, up until a couple of days ago when the resolution on the virtual machine was changed. There is no way (at least for now) to change it back, so I am looking for a solution to rewrite the script.
The element I need to right-click on is now (thanks to the changes in the resolution) not on the screen by default. So when trying to right-click using the coordinates, it fails. I used the "Scroll to"-action in a navigate stage in order to have the element on screen (at the topmost right corner).
What coordinates should I use in order to click that corner? The original ones don't work, I think because they are based on the coordinates of the whole page as opposed to the currently visible screen. I have also tried the original X-value (because the element was originally also almost completely right) and a Y-value of 0, but that didn't work. Neither of these combinations result in a click anywhere else on the screen, which is also a little bit weird to me.
Hopefully I gave enough info. If not, please let me know! Thanks in advance for the help. Hoping someone is able to give me some new insight.
23-04-23 07:16 AM
HI Genma,
Is there any reason for using Coordinates?
I was not sure I understood your question but you can try multiple approaches here.
Since you mentioned you have tried using scroll to that means that element you are trying might be visible after scrolling down - if that is the case then why not use global send keys and identify the desired element?
Here are multiple options I can think of:
1) Use Global send keys
2) Global send key events
3) Global mouse click and global send keys
4) spy in win32 mode and try to capture x and y coordinates
you are able to grab x and y coordinates from the web application if you are able to successfully identify the element
Automation can check the resolution at the beginning stages based on the resolution it use coordinates or any other methods.
If it is drop down you can try to use UIA as well/. There is definitely possible to spy and perform the desired action its just need to play around different options and find most suitable one.
24-04-23 10:09 AM
Hi Gemma,
Another side effect of a changed resolution might be that elements are no longer visible for the Robot as they are outside of the screen and need to be scrolled to. So my effort would be to get the screen resolution to what was used when mapping the application and developing the process.
Prior to running each process, we run a separate little process that does nothing else than setting the screen resolution to the values we require. The screen resolution process is defined within the schedule of each process.
At our shop, the resolution will change whenever maintenance is done on the VDI, or when an admin logs in for support or maintenance. With the pre-run of the resolution process as described above, the settings are always correct when the process is running. So, rather than going about and re-map elements I'd try and get the resolution right.
Happy coding!
---------------
Paul
Sweden