4

When I launch ChromeDriver or IEDriver and click the submit button (manually and automatically), it does not send the inputs. It works outside of webdriver though, I can click the submit button and send the inputs but in webdriver, it doesn't seem do anything. Is this something wrong with webdriver?

Thanks.

Note: The selenium version is the latest 2.47.0 along with chrome and chromedriver. I can't provide the link to the webpage since its a private server. Here is the code for the button

<span id="button-1429-btnInnerEl" class="x-btn-inner x-btn-inner-center" unselectable="on">Submit All</span>
5
  • 1
    Can you add more details like selenium version.ie version,chromeversion, iedriverserver version,chromedriver version, And is it possible to provide the link for the webpage.or html code for the button. Commented Aug 5, 2015 at 16:20
  • The selenium version is the latest 2.47.0 along with chrome and chromedriver. I can't provide the link to the webpage since its a private server. Here is the code for the button...<span id="button-1429-btnInnerEl" class="x-btn-inner x-btn-inner-center" unselectable="on">Submit All</span>.. Thank you Commented Aug 5, 2015 at 16:34
  • are you using sencha extjs application.If yes which version of extJS Commented Aug 5, 2015 at 16:39
  • what's the selector you used [xpath] Commented Aug 5, 2015 at 16:45
  • We're using extJS 4 and I used //span[text()='Submit All'] Commented Aug 5, 2015 at 18:18

6 Answers 6

11

Having the same issue. Using element.sendKeys(Keys.ENTER) solves it for me.

Sign up to request clarification or add additional context in comments.

Comments

2

It will solve, Here I'm using python language. First, you need to import Keys and the following code will help you.

from selenium.webdriver.common.keys import Keys
login_btn=driver.find_element_by_id('button-1429-btnInnerEl').send_keys(Keys.ENTER)

Comments

1

Solution:-

step 1. import org.openqa.selenium.Keys;

step 2. driver.element.sendKeys(Keys.ENTER);

Comments

0

Try to click it with javaScript:

var element = driver.FindElement(By.Xpath("//span[contains(@id, 'button-1429')]"));

 var js = (IJavaScriptExecutor) driver;
 js.ExecuteScript("arguments[0].click()", element);

7 Comments

I tried that but it doesn't work for me. Thanks though
what exception you are getting?
there is no exception, the test passes but it doesn't actually submit anything. When I look at the test, I can clearly see selenium interacting with the button but it doesn't actually submit anything.
Did you inspect the element and typed 'Submit All' in search box to double check if there is only one element with that text. Because if it is not that might be one of the reasons why the button is not being clicked?
I'm only seeing one the element show when I search using the xpath in the console. Good point though. I'm thinking it may have something to do with extjs 4?
|
0

You can try this:-

driver.findElement(By.xpath("//*[contains(text(),'Submit All')]")).click();

2 Comments

can you please add proper explanation for better understanding
I have used customized xpath which finds an element which contains Text "Submit All" and then click on it. If you want xpath with id or name please share the code of the button, which will be definitely starting with <button> or <input> tags.
0

You can use Action Class. Might be Button is in Displayed false.

IWebElement button = driver.FindElement(By.Id("submit")); // locate the button
Actions action = new Actions(driver);
action.MoveToElement(button).Click().Perform(); 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.