Snippet error unless page refreshed

If I scroll down the page first then I try to run the snippet I get an error, but when I refresh the page it works. Why is this happening and anyway to fix?

Hi @mail

Can you please share a screen recording/screenshot of the issue you are facing? And on which website you are facing this issue?

Just get the command to click failed. This is Salesforce. But then I hit refresh and retry and it works fine.

Thanks. Can you share what button you're trying to click on in the first place?

Do you have multiple cases open in Salesforce? Does this work consistently when you have only one tab open?

It still doesn't work consistent if only 1 case open. Its a pencil icon to leave a remark. The code gets stuck here... selector [data-component-id="fieldViewer3"] :nth-child(1) > lightning-output-field > div button

Can you do the following steps:

  1. Right-click on the pencil icon
  2. Select the "Inspect" option - which is usually the last option in the menu.
  3. A panel will open on the right side.
  4. Now take a screenshot of the Chrome window

Please send me this screenshot, so I can suggest a better selector for your use case.

Please see attached.

I think if you use the click command like so, then it would work:

{click: selector=button[title="Edit: Loan_Remark__c"]}

I copied the title string from your screenshot. If you want to adapt this command for clicking on the pencil icon of any other fields, feel free to adjust the title string accordingly.

Let me know if it works for you.

It did work, but like the other one it doesn't consistently work. Salesforce is tough.

If you have time, I'm happy to join a call with you to work on this selector. Please feel free to email on gaurang@blaze.today and we can take a look.