selenium
selenium copied to clipboard
Got content type text/html expected application/json
Sometimes this error happens with our lovely selenium. We don't understand why, but this code is executed from time to time.
https://github.com/tebeka/selenium/blob/9a0798fcb455aca4de72bbe424f4bbb9cb021f53/remote.go#L163
Does this happen when you use firefox? Happen to me and I found out the geckodriver does not use "http://localhost:%d/wd/hub" but "http://localhost:%d" %d is the port
This is also happening to me, but I am using NewRemote
instead of a local instance. I have ran it with Debug set to on, and it is using the correct URL. I am getting it sent to the right place, but it comes back with a 405 Method Not Allowed when I try to Submit it from the element. I am going to try to click on the button instead and see if I get a different result.
I can safely confirm that by clicking on the submit button (instead of using the Submit function), it works as expected.
Does this happen when you use firefox? Happen to me and I found out the geckodriver does not use "http://localhost:%d/wd/hub" but "http://localhost:%d" %d is the port
I think we should update the example so it uses correct url prefix. I hit the same issues today and fixed by following your finding.
Does this happen when you use firefox? Happen to me and I found out the geckodriver does not use "http://localhost:%d/wd/hub" but "http://localhost:%d" %d is the port
Thank You @inluxc @sunshine69
I spent all day on this, and you had the answer right here all along.
I was using NewRemote with Firefox too.