sclevine / agouti

A WebDriver client and acceptance testing library for Go
MIT License
822 stars 105 forks source link

element/click did not match a known command #174

Open gouyang opened 5 years ago

gouyang commented 5 years ago

I have a test like below failed with the error element/click did not match a known command. It's using the geckodriver-0.23.0. It seems the endpoint is not correct, it's supposing to be something like /session/9016e42e-3373-43f3-b9e0-9d667b51b953/element/{element id}/click, the {element id} is not there.

Expect(page.FindByXPath("//*[@id='content']/div[1]/div/div[1]/div/div/span[1]").Click()).To(Succeed())

Error part:

 Expected success, but got an error:
      <*errors.errorString | 0xc000339f70>: {
          s: "failed to click on selection 'XPath: //*[@id='content']/div[1]/div/div[1]/div/div/span[1] [single]': request unsuccessful: POST /session/9016e42e-3373-43f3-b9e0-9d667b51b953/element/click did not match a known command",
      }
      failed to click on selection 'XPath: //*[@id='content']/div[1]/div/div[1]/div/div/span[1] [single]': request unsuccessful: POST /session/9016e42e-3373-43f3-b9e0-9d667b51b953/element/click did not match a known command
Bo0mer commented 5 years ago

I’m having the same issue. If you’re aware of any workaround or what’s needed to fix the issue please share.

Edit: The problem is that geckodriver uses the Webdriver protocol while the agouti implementation uses the JSON wire protocol.

Thanks.