i'm trying to automate a login process on moodle but when i try to find and send keys in the username feild is thsows me error here is my code:
from selenium.webdriver.common.by import By
import webbrowser
from selenium import webdriver
driver = webdriver.Chrome(r'D:\Install\chromedriver_win32\chromedriver.exe')
driver.get("https://lms.jspmrscoe.edu.in/?redirect=0")
username = driver.find_element(By.NAME, 'username').is_displayed()
username.Click()
username.send_keys("name*emphasized text*")
the code works fine till the finding of the element but when i try to click on it by .click() it shows a error is like this:
AttributeError: 'bool' object has no attribute 'Click'
.is_displayed()returns a boolean of True or False depending on whether that element is displayed. You need to checkifthat elementisdisplayedbut then you have to.Click()the element itself, not the result ofisdisplayed