Element selection fails in Chrome and Edge

I recorded a test using Chrome. It works when played back from the recorder, but hangs on a certain page when run as a test in either Chrome or Edge. It works every time in Firefox. I tried manually editing the selector using CSS, XPath and full XPath. I also tried maxing out execution and adaptive wait. It’s just an input box, although it is on a page on a different site - the payment page for a cart->purchase flow. I can’t figure out why it would work on FF every time, but not chrome or edge?

Hi @jeromio, and welcome to our community :slight_smile:

We’ll have to investigate this issue more deeply.

  • Do you get any error messages in the reports?

  • Please share the specific steps in the reports with the element selection that cause the issue.

  • What are you trying to achieve? Are you trying to click on a specific element?
    if you do, can you please try to change the Click action to Click (using JavaScript)

Let me know if you have managed.

The error seems consistent with the agent not being able to find the element:

Message
Action failed using following locators:

1. XPATH=/html/body/div[1]/div/div/div[2]/div/div[2]/form/div[1]/div/div/div[2]/div[1]/div/fieldset/div/div[1]/div/div[1]/span/input
TimeoutException: Timeout occurred while trying to perform the action. Element state is invalid (obscured by another element or invisible): ElementNotVisibleException: Element is not visible
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: 'HOOMPH', ip: '192.168.1.138', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '13.0.1'
Driver info: driver.version: unknown

2. XPATH=//*[@id="cardNumber"]
TimeoutException: Timeout occurred while trying to perform the action. Element state is invalid (obscured by another element or invisible): ElementNotVisibleException: Element is not visible
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: 'HOOMPH', ip: '192.168.1.138', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '13.0.1'
Driver info: driver.version: unknown

Again, this is working fine in Firefox, but not in chrome. It is specifically a page on https://checkout.stripe.com, which seems like someone else must’ve run TestProject against at some point?

There is a Click, but it’s not a necessary part of the flow since ultimately what needs to happen is for the CC number to be input into the text field.

Hi @jeromio ,

Let’s try something like this:

  • Add a new step with the action “execute javascript”, open the dev tools in chrome and copy the JS path of the specific element you want to click/scroll, and reproduce the issue.

  • Paste the string and add .click(); at the end, for example:
    document.querySelector("#jumbo > div > div > div > div > a:nth-child(2) > span").click();

  • Here you have an example with “execute javascript” that will click on a specific element:

chrome_Xwub20tyWK

Let me know if you have managed.

Ok - that worked on Chroe. Which seems odd. So I now have a “Javascript” click, then it goes to the next step, a “normal” recorded one, and fills in the info. And it finds the rest of the elements. I say it’s odd bc, I guess we’ve somehow forced the agent to find that element and then, after that, it seems to find the elements on its own.

Works on Firefox.

However, it still does not work on Edge…

@jeromio
What kind of error message do you get when you are executing on Edge?