I am running into an issue where links change position on the page depending on how many devices are listed so selecting by UI element doesn't work as it won't be in the same row each time, when attempting to set it up with other selectors it doesn't appear that "name" or "text" is an option.
How can I get this to identify the text of the link and select by that?
Solved! Go to Solution.
I don't know about that, but there is a move mouse to text on screen (OCR) action. It will OCR the active window and move the mouse to the text you want; if it works.
One workaround could be to loop through all elements with the given class/id and use Get details of a UI element to get "Own text". When it matches the value you are looking for you click the link.
Like section[Class="top-bar-section"] a[Class="main-level"]:eq(%LoopIndex%)
Use a danish version of the program but i guess you can see what i mean? 🙂
I like the idea of the OCR, but it doesn't seem to be working.
As far as looping through the page to find the link, I don't mind this approach, but can't follow this well enough with the current screenshot provided in Danish. Can someone help with this approach in English?
I have the same issue. What I use is the move mouse to text via OCR. It helps to use the setting to look in subregion of foreground window.
This sounds very basic but I got a dry erase marker and put 2 dots on my screen in the area I know the text should appear. Then I go back to PAD. Open "move mouse" and move my cursor to the dots. I write down the X and Y points for each dot. Then I cancel out of "move mouse" because it was just to notate the points. I go back to my OCR box and fill the points in for the subregion. Also, increase the tolerance to 2 or 3.
I see your UI element is: td:eq(5) > a[id=Row2Col2] , the up level tag <tr>'Row2' you haven't select.
To use the method provide by @Michael531, depends on the webpage's structure, the number in the html structure need to replace to %LoopIndex%,
could be like this:
td:eq(%loopIndex%) > a
or td:eq(5) > a[id=Row%loopIndex%Col2]
or tr[id=Row%loopIndex%] > td:eq5 > a
you could locate the element on the webpage's structure by right click on the element, select "Inspect".
for the structure:
if a html is like below:
you could locate the td with:
1st td: tr > td:eq(0)
2nd td: tr > td > td:eq(0)
3nd td tr > td > td:eq(1)
4th td tr > td:eq(1)
Could you please open the webpage, and press ctrl+shift+i
Then click on the "select element in page to inspect" (marked by the red arrow) and click on the UI you want.
Take a screen shot and post it here.
There are many times where PAD sucks at getting all the good stuff you can use to identify a UI correctly.
This worked perfectly and is an extremely easy update requiring no additional code added into the script!
Why doesn't Microsoft make this information more readily available?!
Thank you Henrik_M!