WebDriver - element is not clickable Chrome

前端 未结 8 1133
攒了一身酷
攒了一身酷 2021-02-04 10:56

I have following problem. I run test on Firefox and Chrome. On Firefox test run correctly but on Chrome SauceLabs give a message:

unknown error: Element is not          


        
相关标签:
8条回答
  • 2021-02-04 11:23

    I am assuming that you have the correct element you need, ie the XPath is correct. Here are few ways out:

    1. Try to Click on the parent element instead.
    2. Try .Submit() instead of .Click()
    3. Try to execute the JavaScript that will be executed on the OnClick event of the element you are trying to click.

    I have used the 3rd way with success all the time.

    Another one

    1. Do a .SendKeys(Keys.Enter) on that element (or a Space key)
    0 讨论(0)
  • 2021-02-04 11:25

    For me, it was creating this command instead.

    driver.FindElementByXPath("id('gender1')").SendKeys(Keys.Space);
    

    For my case, I was interacting with radio control.

    0 讨论(0)
提交回复
热议问题