模块十 文件上传弹框处理

 

from selenium_js.base import Base
from time import sleep

class TestFile(Base):
    def test_file(self):
        self.driver.get("https://image.baidu.com/")
        self.driver.find_element_by_xpath("//*[@id='sttb']/img[1]").click()
        self.driver.find_element_by_id("stfile").send_keys("D:pyHJJselenium_jsdetail.html")
        sleep(4)

原文地址:https://www.cnblogs.com/hantongxue/p/14399302.html