Trying to lock vertical coordinates after command+f'ing

As part of a process I have to find a phrase "lead notes" half way through a long webpage and click it. There are 100s of different pages and it's always horizontally in the same place after command+f'ing but is always in a different place vertically.

Any ideas on how I could make sure it's in the same exact coordinates each time so I can automate this process?

This sounds like a perfect job for JavaScript. Unfortunately that's something I'm very poor at. Someone else will chime in. They might ask you to locate the name of the button in the HTML code. Are you will to dig up that information, or are you willing to send a link to the web page?

Ah I see, its a salesforce page so not publicly available,

I inspected element and this is what was highlighted does this look right?

< lightning-primitive-icon data-aura-rendered-by="2831:0" lightning-primitiveicon_primitiveicon-host="" > 
< svg lightning-primitiveIcon_primitiveIcon="" focusable="false" data-key="edit" aria-hidden="true" class="slds-button__icon" > 
< use lightning-primitiveIcon_primitiveIcon="" xlink:href="/_slds/icons/utility-sprite/svg/symbols.svg?cache=9.26.0#edit"  >
 < /use > 
</svg >
< /lightning-primitive-icon > 

I'm really not sure if that's what the Javascript experts here will need. I get the impression they may not be online at this time of day.

But if that fails, and you're willing to settle for an imperfect solution, we can probably get you going another less efficient way.

Actually it does not. I don't see the phrase "lead notes" in the HTML, and it needs to be there.

Please provide the following:

  1. A screenshot of the area of the page you need to work with.
  2. The HTML from a much broader section around the text of interest. Typically this will be with <div> tags, at least two levels above. Better to provide too much than too little.

Then we need to know exactly what workflow you are trying to automate. Please list the manual steps (1., 2., 3., ...) that you would perform to achieve the result you want.

Also, in the future, please put all code, scripts, etc (like HTML) in a Forum Code Block. Use "html" for the language in this case.

Hey thanks so much for your help.

This process involves ~20 clicks and I'd like to explore scripting the whole thing in the future (if it makes sense) but for right now, it's just this one click that's giving me problems since it isn't locked in the same coordinates each time.

Below are the relevant actions. Below that are the 2 relevant screenshots.

->Move mouse and click (the blue pen next to lead notes, this opens the text field)
->Insert text by typing "qualified"
->Move mouse and click (hits save button)

Save is always in the same spot so I just do it by coordinates but the blue pen is always different vertically.

Before hitting the pen button next to lead notes
After hitting the pen button

Contrary to what I said prior in the chain, the actual goal is to click that highlighted blue pen icon next to lead notes, not lead notes itself.

<div class="slds-form-element__control slds-grid itemBody" data-aura-rendered-by="2661:438;a"> 
<span class="test-id__field-value slds-form-element__static slds-grow " data-aura-rendered-by="2662:438;a">  
<span data-aura-rendered-by="2652:438;a" class="uiOutputTextArea" data-aura-class="uiOutputTextArea">
<!--render facet: 2654:438;a-->
<!--render facet: 2664:438;a-->
<button class="slds-button test-id__inline-edit-trigger slds-button_icon slds-button_icon-small slds-shrink-none inline-edit-trigger slds-button_icon-container" type="button" title="Edit Lead Notes" data-aura-rendered-by="2058:0">
<lightning-primitive-icon data-aura-rendered-by="2059:0" lightning-primitiveicon_primitiveicon-host="">
<svg lightning-primitiveIcon_primitiveIcon="" focusable="false" data-key="edit" aria-hidden="true" class="slds-button__icon">
<use lightning-primitiveIcon_primitiveIcon="" xlink:href="/_slds/icons/utility-sprite/svg/symbols.svg?cache=9.26.0#edit">
<span class="slds-assistive-text" data-aura-rendered-by="2061:0">Edit Lead Notes</span>

Does this look more like it? Also in between the two "uses" there was a line that said #shadow-root that I couldn't copy and paste, is this important for our purposes?

That sounds so simple you could just use the Find Image action. Insert the blue image of the pen into the Find Image action. Set the action's options to click at the center of the image.

This sounds too easy to be the right solution.

Too easy unfortunately, that pen icon is only blue because I was hovering over it, the rest of them do that as well

Oh, um, then let me reconsider.

Is the "Lead Notes" field (the button, I meant) always the exact same vertical distance above the Save button? Prior to clicking on the pen icon?

[I might be mis-standing your question] Sorry if it wasn't clear but the screenshots above are 2 different images, the first before hitting the pen button, the second after hitting the pen button.

The save button only pops up after you hit the pen button and once you hit the pen button, the pen button goes away until you hit save button,

You were perfectly clear, I'm just an idiot, especially after just waking up. Let me reconsider now.

Alright, but in your "before" screenshot you aren't showing the entire window. I'll bet there's something else in that unredacted window that is in a fixed location relative to the link you re trying to click on. Even if you don't want to show the whole window, take a good look at it yourself and see if there's something in a predictable location that's easy to see relative to the button you want to click on. Even if it's 6 inches away.

Hah, all good I'm just thankful for your help.

You might be right but I don't think there is. Here's a bigger picture. With the web pages I'm dealing with there are dozens of panels ( often different amounts ) and the "lead details" panel is always there but it's always in a different place. Even within the Lead Details, if there was multiple lines of information in any of the fields it would move things around and I don't think there would be a good anchor point.

Perhaps this app is trying to prevent automation. Well, based on what you said I think you have to use Find Image to search for the actual words "Lead Notes". Those words aren't ideal fodder for the Find Image action, but in cases like this, see if it works, with the default fuzz factor, and if it doesn't work I can give you advice about how to make it work.

To reiterate, create a Find Image action, paste a graphic in the image box of that action with the words "Lead Notes" in it, and set an offset of about 400 pixels to the right so that it hits the pen mark. Do you understand what I'm saying here? It's hard for me to write the code for you because I don't have your screen or the same resolution as you have.

I don't think it's trying to prevent automation there's just varying amounts of information on each page, different times that the account was created.

Your suggestion worked perfectly thanks! I had to do a command+f function first to get that area on the page but with that it works great. I'm curious if scripting will make the whole process better in the future but this works great for now, thanks so much!

OK, thanks for the screenshots and HTML. That really helps, but this is still a VERY limited set of the HTML code.

Assuming that the pencil button you want to click on is either the first such button, or the only such button, then this JavaScript might work. I can't say for sure without the actual page URL.

var btnElem = document.querySelector('button[title*="Edit Lead Notes"]');
if (btnElem) {;
} else { window.alert('Button for Edit Lead Nots NOT Found'); }

Just put this in a Execute a JavaScript in Front Browser action,

Open the target web page and trigger a macro with this action.
If that works, then we can enhance it to further automate it.

JavaScript is much, much faster than using found image, and more reliable.

Yeah and unfortunately after digging in deeper I was having problems with the found image strategy.

There's hundreds of pencil buttons on that page so it's neither the first or the only.... is this even possible at this point?

If it is, Here's a screenshot of a greater section of code, maybe you could identify a start and an end point from which I can provide for you?

I know, Find Image is finicky and it's hard to remotely assist with making it work. There are various ways to improve its effectiveness, but for now keep working on a Javascript option with JM.

I suspected that.

Nope. It is going to be up to you to describe in detail how you want to select the "Lead Notes" you want to enter. How do you actually choose? Is it the name of the company, or something else?