Submit button is not clicking even though python script is executed-Python Selenium

By Ramesh

In my testing, one of the page is having “Submit” button and when i try to click on submit button is not working (not clicking) even though script is executed.

Below is the HTML code for the submit button

<button class="btn btn-primary" name="submit_button" value="1" type="submit">
<i class="fa fa-check"></i>
Submit

I have written the scripts as like below to find submit button element.

time.sleep(6)
sub = web.find_element_by_name("submit_button")
sub.click()

I have tried to find element using “Xpath” (Absolute XPath and Relative XPath) as well and observed that did not work. one more thing is that,the accessible page is in “iframe”
and i have access that as like below

web.switch_to.frame("page-content")

To confirm that whether the scripts is running or not i have modified above code as like below.

time.sleep(6)
print ("hello")
sub = web.find_element_by_name("submit_button")
print ("hello1")
sub.click()
print ("hello2")

From above code i got know that scripts were executing successfully
Please guide me what is the issue?
Answers are much appreciable!

Source: Stack Overflow

    

Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273