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();
    
    	}
    	
    	
    
    }
    
  • 相关阅读:
    View Programming Guide for iOS ---- iOS 视图编程指南(四)---Views
    Java设计模式---原型模式(Prototype)
    Java设计模式----建造者模式(Builder)
    Java设计模式----单例模式(Singleton)
    Java设计模式---工厂方法模式(Factory-Method)
    Hibernate之基于外键映射的一对一(1-1)关联关系
    Hibernate关联关系之双向1—n
    修改Map中确定key对应的value问题
    Hibernate关联关系之——单向n-1
    Hibernate之Session对象的相关方法以及持久化对象的状态
  • 原文地址:https://www.cnblogs.com/wujianbo123/p/7710902.html
Copyright © 2011-2022 走看看