• 浏览器__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();
    
    	}
    	
    	
    
    }
    
  • 相关阅读:
    Windows 8.1更新变化
    Hibernate Criterion
    HDU 2795 Billboard(宣传栏贴公告,线段树应用)
    解决ccSvcHst.exe CPU占用超50%的问题,及其缘由
    设计模式之解释器模式(Interpreter)摘录
    中国软件开发project师之痛
    【翻译】ExtJS vs AngularJS
    天将降大任于斯人也,必先苦其心志,劳其筋骨,饿其体肤,空乏其身,行拂乱其所为,所以动心忍性,增益其所不能
    linux概念之内存分析
    java实现第四届蓝桥杯带分数
  • 原文地址:https://www.cnblogs.com/wujianbo123/p/7710902.html
Copyright © 2020-2023  润新知