首页 > Web开发 > 详细

Se(10)---上传文件

时间:2017-05-07 10:04:32      阅读:218      评论:0      收藏:0      [点我收藏+]

package test;


import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.chrome.ChromeDriver;

import org.testng.annotations.Test;


public class lesson9 {


@Test

public void test() throws InterruptedException{

System.setProperty("webdriver.chrome.driver", "D:/01 Learn WebDriver/chromedriver.exe");

WebDriver dr = new ChromeDriver();

dr.manage().window().maximize();

        dr.get("http://www.layui.com/demo/upload.html");

        Thread.sleep(3000);

        

        //上传文件

WebElement el1 = dr.findElement(By.id("test"));

el1.sendKeys("d:/1.jpg");

//dr.quit();

}

}


Se(10)---上传文件

原文:http://11009785.blog.51cto.com/10999785/1922697

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!