In this scenario, I am trying to click on the submit button with Selenium webdriver but so far have been unable to click the element.
<button type="submit" class="pcty-button pcty-size-medium pcty-button-full-width pcty-button-full-width-mobile pcty-size-responsive submit-button login-button">Login</button>
The code that I have to locate the button as it is now reads as:
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//button[@type='submit' and normalize-space()='Login']"))).click()
I thought that this code was covering all of the bases and expected it to click the button, but have had no luck so far. Every error I have seen with other code has raised that no element existed or it was unable to locate.
The error that I get is:
raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException
I've used some answers to try and find a solution from these threads: 1 and 2 but as of right now I have no clue what I am doing wrong.
I have been asked for a larger part of the HTML of this webpage for context.
If I need to expand even more of it, I am happy to do so. The answers provided have been tested and come up with the same timeout errors.
<div class="pcty-col pcty-padding-top pcty-large-padding-horizontal">
<div class="pcty-input pcty-input-checkbox">
<label class="pcty-checkbox-label pcty-input-label" for="IsRememberingUser">
<input type="checkbox" checked="checked" data-val="true" data-val-required="The IsRememberingUser field is required." id="IsRememberingUser" name="IsRememberingUser" value="true">Remember My Username
</label>
</div>
</div>
</div>
<div class="pcty-row-flex">
<div class="pcty-col pcty-padding-top pcty-large-padding-horizontal">
<button type="submit" class="pcty-button pcty-size-medium pcty-button-full-width pcty-button-full-width-mobile pcty-size-responsive submit-button login-button">Login</button>
</div>
</div>```