-----》点击元素不生效,解决方法:用js脚本的方式点击元素
def js_click(self,locator): # js 脚本的单击,需要设置等待时间 time.sleep(5) ele = self.driver.find_element(*locator) js_code = """arguments[0].click();""" self.driver.execute_script(js_code, ele) def js_sendkeys(self,locator,value): #js脚本的发送,value=要发送的值 time.sleep(5) ele = self.driver.find_element(*locator) js_code = f"""arguments[0].value={value}""" self.driver.execute_script(js_code,ele)