'The inputs gives proper result but button doesn't work in selenium simple program
This is a simple code to add two values but whenever the code came to button it gives an error 'NoneType' object has no attribute 'click'. The values are filled up but button doesn't work.
import os
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
os.environ["PATH"] += r"C:\python practice\Selenium"
driver=webdriver.Chrome()
driver.get("https://www.rapidtables.com/calc/math/Add_Calculator.html")
number1 = driver.find_element(By.NAME, "x")
number2 = driver.find_element(By.NAME, "x2")
number1.send_keys(Keys.NUMPAD1,Keys.NUMPAD5)
number2.send_keys(16)
driver.implicitly_wait(30)
btn = driver.find_element_by_css_selector('button[onclick="calc3()"]')
btn.click()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
