Проблема с элементом catch для автоматизации тестирования python selenium (python 37-32), я попробовал имя_класса css_selector xpath
<input type="text" size="2" class="input et_pb_contact_captcha" data-first_digit="8" data-second_digit="4" value="" name="et_pb_contact_captcha_1" data-required_mark="required" style="" xpath="1">
Я попробовал с именем_класса
self.driver.find_element_by_class_name("input et_pb_contact_captcha").send_keys("-1")
driver.find_element_by_css_selector("input.input.et_pb_contact_captcha").send_keys("-1");
xpath//input[@name='et_pb_contact_captcha_1']
from selenium import webdriver
import time
import unittest
class CheckTest(unittest.TestCase):
def setUpClass(cls):
cls.driver = webdriver.Chrome("C:\chromedriver_win32\chromedriver.exe")
cls.driver.implicitly_wait(15)
cls.driver.maximize_window()
def test_check_valid(self):
self.driver.get("www.site.com")
self.driver.find_element_by_class_name("input").send_keys("test")
self.driver.find_element_by_class_name("et_pb_contact_message input").send_keys("test")
self.driver.find_element_by_css_selector("input.input.et_pb_contact_captcha").send_keys("-1");
У меня проблема с этим элементом
self.driver.find_element_by_css_selector("input.input.et_pb_contact_captcha").send_keys("-1");
Traceback (most recent call last):
File "C:\Python37-32\automation\testcheck.py", line 11, in <module>
driver.find_element_by_class_name("input et_pb_contact_captcha").send_keys("-1")