ant无法编译InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS

问题描述

webdriver类[b]:packagedemonsFirstTestNG;importorg.openqa.selenium.By;importjava.lang.Exception;importorg.openqa.selenium.*;importorg.openqa.selenium.htmlunit.*;importorg.openqa.selenium.ie.InternetExplorerDriver;importorg.openqa.selenium.support.ui.ExpectedCondition;importorg.openqa.selenium.support.ui.WebDriverWait;//importorg.openqa.selenium.JavascriptExecutor;importorg.openqa.selenium.remote.DesiredCapabilities;importorg.openqa.selenium.remote.RemoteWebDriver;//importorg.openqa.selenium.htmlunit.*;importorg.openqa.selenium.firefox.FirefoxDriver;importorg.openqa.selenium.support.ui.*;importjava.net.*;importjava.io.*;importorg.apache.logging.log4j.*;publicclassTestbaiduSigle{StringbaseUrl;WebDriverdriver;privateLoggerloger=LogManager.getLogger(TestbaiduSigle.class.getName());/***@paramargs*/publicTestbaiduSigle(){loger.info("startopenURL....");baseUrl="http://www.baidu.com/";System.setProperty("webdriver.ie.driver","G:\Auto_project\java\lib\IEDriverServer.exe");DesiredCapabilitiescapabilities=DesiredCapabilities.internetExplorer();capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);System.out.println("driverstart");driver=newInternetExplorerDriver(capabilities);}publicvoidtestexe(){System.out.println("openURLstart");driver.get(baseUrl+"/");//driver.wait(3000);System.out.println("start");newWebDriverWait(driver,20).until(newExpectedCondition<WebElement>(){@OverridepublicWebElementapply(WebDriverd){//TODOAuto-generatedmethodstubreturnd.findElement(By.id("kw"));}}).sendKeys("testuser");System.out.println("end");driver.findElement(By.id("su")).click();}publicstaticvoidmain(String[]args){TestbaiduSigletw2=newTestbaiduSigle();try{tw2.testexe();System.out.println("itisok");}catch(Exceptione){System.out.println(e.toString());}}}[b]ant运行报错:G:Auto_projectantTestNGWebdriverStudy>antBuildfile:G:Auto_projectantTestNGWebdriverStudybuild.xmlclean:[delete]Deleting:G:Auto_projectantTestNGWebdriverStudysrcdemonsFirstTestNGTestbaiduSigle.java[delete]DeletingdirectoryG:Auto_projectantTestNGWebdriverStudyclasses[delete]DeletingdirectoryG:Auto_projectantTestNGWebdriverStudylibinit:[copy]Copying1filetoG:Auto_projectantTestNGWebdriverStudysrcdemonsFirstTestNG[mkdir]Createddir:G:Auto_projectantTestNGWebdriverStudyclasses[mkdir]Createddir:G:Auto_projectantTestNGWebdriverStudylibcompile:[javac]Compiling1sourcefiletoG:Auto_projectantTestNGWebdriverStudyclasses[javac]G:Auto_projectantTestNGWebdriverStudysrcdemonsFirstTestNGTestbaiduSigle.java:39:找不到符号[javac]符号:变量INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS[javac]位置:类org.openqa.selenium.ie.InternetExplorerDriver[javac]capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);[javac]^[javac]1错误BUILDFAILEDG:Auto_projectantTestNGWebdriverStudybuild.xml:30:Compilefailed;seethecompilererroroutputfordetails.Totaltime:1secondbuild.xml文件配置:<?xmlversion="1.0"encoding="gbk"?><projectname="TestNGWebdriverStudy"default="run"basedir="."><propertyname="src"value="src"/><propertyname="dest"value="classes"/><propertyname="lib"value="lib"></property><propertyname="third_lib"value="../../java/lib"></property><!--propertyname="hello_jar"value="Helloword.jar"></property--><propertyname="Tweb_jar"value="TestNGWebdriverStudy.jar"></property><!--导入第三方JAR包<pathelementpath="${third_lib}/selenium-server-standalone-2.40.0.jar"/><libfilesetdir="${third_lib}"includes="*.*"/>--><pathid="lib_classpath"><filesetdir="${third_lib}"><includename="*.jar"/></fileset><pathelementlocation="${dest}"/></path><!--初始化之前执行删除操作--><targetname="init"depends="clean"><copyfile="../../java/TestNGWebdriverStudy/src/demonsFirstTestNG/TestbaiduSigle.java"todir="src/demonsFirstTestNG"></copy><mkdirdir="${dest}"/><mkdirdir="${lib}"/></target><!--编译生成class文件--><targetname="compile"depends="init"><javacsrcdir="${src}"destdir="${dest}"classpathref="lib_classpath"includeantruntime="off"debug="on"></javac><!--classpathrefid="lib_classpath"/--></target><!--将编译后的class文件打包--><targetname="build"depends="compile"><mkdirdir="${lib}"/><jarjarfile="${lib}/${Tweb_jar}"basedir="${dest}"></jar></target><!--删除--><targetname="copyF"depends="build"><copyfile="log4j2.xml"todir="${dest}"></copy><!--是copy文件--></target><targetname="run"depends="copyF"><!--javaclassname="demonsFirstTestNG.Helloword"jar="${third_lib}"classpath="${lib}/${hello_jar}"><classpathrefid="lib_classpath"/></java--><javaclassname="demonsFirstTestNG.TestbaiduSigle"classpath="${lib}/${Tweb_jar}"><classpathrefid="lib_classpath"/></java></target><!--删除--><targetname="clean"><deletefile="./src/demonsFirstTestNG/TestbaiduSigle.java"></delete><deletedr="${dest}"></delete><deletedir="${lib}"></delete><!--是dir删除目录,不是file删除文件--></target></project>eclipse运行结果21:50:14.048[main]INFOdemonsFirstTestNG.TestbaiduSigle-startopenURL....driverstartStartedInternetExplorerDriverserver(32-bit)2.25.2.0Listeningonport129762014-7-1921:50:16org.apache.http.impl.client.DefaultRequestDirectortryExecute信息:I/Oexception(java.net.SocketException)caughtwhenprocessingrequest:Softwarecausedconnectionabort:recvfailed2014-7-1921:50:16org.apache.http.impl.client.DefaultRequestDirectortryExecute信息:RetryingrequestopenURLstartstartenditisok求助问题1.为啥在esclipse都可以正常编译运行,能正常运行完成,有如上运行结果报错信息2.同样的java文件在ant环境下编译就无法编译通过,ant无法编译InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,请那位高手帮助一下。

解决方案

时间: 2024-07-31 19:51:20

ant无法编译InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS的相关文章

ant+ivy编译工程的时候,下包下失败,求教!

问题描述 ant+ivy编译工程的时候,下包下失败,求教! 解决方案 Ant Ivy

Android中使用ant混淆编译

1.拿一个普通项目来说,首先为它加上ant编译功能.  代码如下 复制代码 android update project --name project_name -t 3 -p D:/temp/project_name 此时会在项目根目录自动生成一个名为build.xml的ant脚本.上面的project_name是你的项目名称. 2.加入混淆功能 就第一步来说,在命令行中已经可以使用ant进行编译了.因为Android中是这样的,在输入命令ant debug的时候会自动调用D:/android

为ant指定编译版本

  用Eclipse的ant折腾了一天也没搞清楚为什么同样的设置ant出的class版本却不一样.后来下载个ant工具在命令行执行通过. 从网上抄得指定编译版本的方法如下: ant 运行时,必需依赖jdk6.0,而是用ant编译java文件时,却需要是用jdk1.4或者1.5.那如何指定ant编译版本呢? 最近发现了两种解决方案: 1.为 javac 任务指定target属性,取值为:1.3.1.4.1.5 即自己需要编译源码的版本,部分源码: <target name="main2&qu

ant 如何编译引用了其他项目的项目

问题描述 例如,想编译A项目,但是A项目里面有引用到了B项目的类,如何顺利通过编译?麻烦大家了. 解决方案 解决方案二:需要把b也编译生成jar包,导入a的jar包中,然后继续编译a解决方案三:EJB+JBOSS+struts1之前银行工作的一套是这样的:Antbuilding一般来说是先编译相关依赖包,编译之后,会统一打包成XXXX.ear的东西,就包含了你之前编译的两个文件

Ant自动编译测试的问题,测试覆盖度总为100%

问题描述 大家好,我写了一个ant来让项目自动跑.其中JUnit和覆盖度相关的Target为:<targetname="instrument"depends="build"><deletefile="cobertura.ser"/><deletedir="${instrumented.dir}"/><cobertura-instrumenttodir="${instrumen

Android应用程序的编译流程及使用Ant编译项目的攻略_Android

Android 工程构建的持续集成,需要搭建一套编译和打包自动化流程,比如建立每日构建系统.自动生成发布文件等等.这些都需要我们对Android工程的编译和打包有一个比较深入的理解,例如知道它的每一步都做了什么,需要什么环境和工具,输入和输出是什么,等等. 首先,假定你的系统(Windows.Linux.Mac OS都行,本文默认使用Linux系统来举例子,但在 Windows中几乎没有什么差别)已经安装了JDK和Android SDK. 我们重点关心的是:     (1)这个过程的输入是什么?

ant编译mysql驱动

修改驱动源码后需要重新编译构建,由于mysql编译需要两个jdk版本且还需要hibernate4和junit,这里记录下. 安装ant. 配置两个jdk,5和8.并修改build.xml配置,如下: <property name="com.mysql.jdbc.jdk5" value="/usr/java/jdk1.5.0_15" /> <property name="com.mysql.jdbc.jdk8" value=&qu

Android应用程序的编译流程及使用Ant编译项目的攻略

Android 工程构建的持续集成,需要搭建一套编译和打包自动化流程,比如建立每日构建系统.自动生成发布文件等等.这些都需要我们对Android工程的编译和打包有一个比较深入的理解,例如知道它的每一步都做了什么,需要什么环境和工具,输入和输出是什么,等等. 首先,假定你的系统(Windows.Linux.Mac OS都行,本文默认使用Linux系统来举例子,但在 Windows中几乎没有什么差别)已经安装了JDK和Android SDK. 我们重点关心的是:     (1)这个过程的输入是什么?

jakarta-ant的使用(java编译工具)

编译 一:介绍: ant 是jakarta的一个编译工具,如果你了解linux/Unix下的makefile你就很容易 理解ant的用途了.ant最适合你使用UltraEdit(EditPlus)写java程序,然后你使用ant去编译,同时javadoc ,生成一个jar,war,实现文件的copy都可以在build.xml通过不同的tager去实现,还是很方便的一个东东强烈推荐是使用.二:下载 你可以从下面的地址下载到ant,目前版本:1.41 http://jakarta.apache.or