zoukankan      html  css  js  c++  java
  • 浏览器__IE

    一、代码如下

    package www.gui.liulanqi;
    
    import java.io.IOException;
    import java.util.concurrent.TimeUnit;
    
    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.ie.InternetExplorerDriver;
    import org.openqa.selenium.interactions.Actions;
    import org.openqa.selenium.remote.DesiredCapabilities;
    
    public class Ie {
    	WebDriver driver= null;
    	Actions actions= null;
    
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    		Ie gd= new Ie();
    		gd.init();
    		//gd.killDo();
    		//gd.tableProcess();
    
    	}
    	
    	private void init() {
    
    		//System.setProperty("webdriver.ie.bin", "C:\Program Files\Internet Explorer\iexplore.exe");
    		//C:Program FilesInternet Exploreriexplore.exe
    		System.setProperty("webdriver.ie.driver", "d:\IEDriverServer.exe");
    		//C:Documents and SettingsAdministratorLocal SettingsApplication DataGoogleChrome
    		//C:Documents and SettingsAdministratorLocal SettingsApplication DataGoogleChrome
    		//C:Program Files (x86)GoogleChromeApplicationchrome.exe
    		//this.driver = new FirefoxDriver();// 启动火狐浏览器
    //		DesiredCapabilities dc= DesiredCapabilities.internetExplorer();
    //		dc.setCapability("ignoreProtectedModeSettings", true);
    //		this.driver= new InternetExplorerDriver(dc);
    		this.driver= new InternetExplorerDriver();
    
    		this.driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);// 元素等待时间
    		this.driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);// 页面加载时间
    		this.driver.manage().timeouts().setScriptTimeout(30, TimeUnit.SECONDS);// ajax请求
    		this.driver.manage().window().maximize();
    		// this.driver.get("https://www.baidu.com/");// 在浏览器中打开该网址
    		this.driver.get("http://localhost/Agileone/");
    //		this.driver.findElement(By.id("username")).sendKeys("admin");
    //		this.driver.findElement(By.id("password")).sendKeys("admin");
    //		this.driver.findElement(By.id("login")).click();
    //			
    //		this.driver.findElement(By.partialLinkText("需求提案")).click();
    
    	}
    	
    	
    
    }
    
  • 相关阅读:
    asp.net大文本保存 framework4.0
    temp文件夹权限对ASP网站以及ASP.NET网站的影响【转载】
    将access数据转移到sql server
    MVC图片上传、剪辑、缩略、水印
    魔兽War3按键精灵Ⅱ(201294)
    PHP中应用CKEditor和CKFinder上传图片读取图片
    C#中get和set个人理解
    asp.net验证码实现
    转三篇文章关于php中session机制
    ORM组件 ELinq (五)映射配置之XML
  • 原文地址:https://www.cnblogs.com/wujianbo123/p/7710902.html
Copyright © 2011-2022 走看看