[PYTHON] Clicking on name attribute in Selenium does not submit

problem

I want to submit the form by clicking the submit button.

Form.html


<input type="submit" name="post" value="Post" />

FormTest.cs


driver.FindElement(By.Name("post")).Click();

Works locally, On the test server, there is one screen where an error occurs every time. Why.

solution

SendKeys works! (StackOverflow.com)

FormTest.cs


driver.FindElement(By.Name("post")).SendKeys(Keys.Enter);

Or

FormTest.cs


driver.FindElement(By.Name("post")).SendKeys(Keys.Return);

Cause (?)

It looks like a bug. It is closed because I do not know the reproduction scenario. Issue 2864:Clicking with 2.12.0 using Firefox 5 sometimes works and sometimes does not

Afterword

My environment is as follows. Selenium: 2.41.0.0(C#) Local: Windows 7 (x86) + Firefox 29.0.1 Test server: Windows Server 2012 R2 + Firefox 29.0.1

I'm developing HTML / CSS in parallel When I noticed it, it was also sent by Click. Caused by HTML or CSS? I will check it when I feel like it.

Recommended Posts

Clicking on name attribute in Selenium does not submit
LocateCenterOnScreen does not work on PyAutoGui
Path problem does not occur on debian-linux
Virtualenv does not work on Python3.5 (Windows)
tensorflow does not enter in windows + anaconda.
In Ruby, inspect does not substitute to_s
Jinja2 2.9.6 does not work on Lambda Python 3 series
jupyter notebook does not start on mac fish