WebDriver高级应用:操作日期控件

操作日期选择控件的实例代码:

该页面日期控件支持输入,若遇到日期不允许用户输入的情况,可以通过JavaScript语句改变页面元素属性值的方式将日期控件修改成可编辑状态,以便完成脚本直接输入日期来进行日期选择;

# encoding = utf-8

from selenium import webdriver

import unittest,time,traceback

from selenium.webdriver.support.ui import WebDriverWait

from selenium.webdriver.common.by import By

from selenium.webdriver.support import expected_conditions as EC

from selenium.common.exceptions import TimeoutException, NoSuchElementException

class TestDemo(unittest.TestCase):

def setUp(self):

猜你喜欢

转载自blog.csdn.net/xjtlzl/article/details/81193506