I want to automate the clicking of a link on a webpage. The trick is, the location of the link is always in a different location, however it is always named the same. Is there a way to 1)FIND the link (based on name or text) and then 2)CLICK it?
Yes – the click [ Chrome | Safari ] link (by label) actions are excellent and a lot simpler – using an XPath just has a little more reach and power for the edge cases.
The kind of thing that comes to mind is:
multiple links with the same legend – several links labelled 'Download' on one page for example
links with a graphic but no text
links with mutable or unpredicable text etc
( When the label is an elusive anchor you can often still reach for an XPath and specify a link by some aspect of its relative or absolute position in the page structure)
There's an example here of clicking something by its HTML element id rather than by its <a> text:
Ah I see! Thanks for following up; turns out your method is exactly what I needed for another one of my macros (which involves a website in one of those “edge cases”). Cheers!
What would you do in the case where the element you want to click is a button (and as such is a graphic without text) where the underlying XPath is different depending upon the record from which you’re clicking it?
I’d like to use KM to click a button to log a call to a contact in my Salesforce CRM system. Clicking the “Log a Call” button creates a new call record that is related to the contact record from which the button is clicked. The XPath for the button is nearly identical on each record, but with a slight variation:
How would I best handle that scenario? I’m currently doing it using a screenshot of the button as a found image on the page, but using Path would be much more robust, so I’d like to switch to that if at all possible.
I realize that this is an ANCIENT thread, but I'm working on something similar, and rather than trying to explain it all again . . . .
I'm trying to use the click Front Browser Link (I am using Brave Browser), and I can't seem to get it to work. Here are a couple of representative pages:
I need to click on the "Edit" link in the top middle of the page. Notice that the Edit link moves horizontally depending on the length of the person's name. So it's not really possible to use a "position" because it's never quite right.
When I use the "Click Front Brower Link "Edit", nothing happens.
So for now, I have a "move to" and "just move" action that "sometimes" gets me there, so I can just click. But most times I have to actually use the mouse to open this link.