简体   繁体   中英

Upon clicking the submit button the screen scrolls down and does nothing

I am using Selenium Webdriver (Java) with Firefox driver. When i hit the 'Submit' button on a specific page, it does nothing other than scrolling the screen down a bit. The 'Submit" button does not gets clicked and the rest of the operation fails.

Anyone has a clue why it does like this? I have tried clicking the same button with its ID, css and xpath. Does the same using all these locators.

This could be happening that other element could be receiving click instead of the Submit button. It can be resolved using Actions class as below by moving focus first to The submit button:

 WebElement submitButton = driver.findElement(By.cssSelector("button#pmc_wizard_next"));

 Actions action = new Actions(driver);
 action.moveToElement(submitButton).click().build().perform();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM