Despite my efforts to find a way to click on a button using webdriver, I have yet to solve the issue. Can someone please assist? Below is the HTML snippet in question:
<b>
<input name="submit" onclick="javascript:document.getElementById('submitClicked').value='Next';return true;" type="submit" tabindex="2" class="-opa-btn-primary nextButton" value="Next" alt="'Next'" id="submitNext">
</b>
I am attempting to click on the "Next" button.
My attempts so far:
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("return document.getElementById('submitClicked').value='Next';return true;");
This approach resulted in an exception stating that document.getElementBy ID returned null.
Next, I tried:
if(driver.findElement(By.Id("submitNext").isEnabled())
driver.findElement(By.Id("submitNext").click();
Unfortunately, this method also did not work.