Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse 运行selenium脚本时出错_Eclipse_Selenium Webdriver_Maven 2 - Fatal编程技术网

Eclipse 运行selenium脚本时出错

Eclipse 运行selenium脚本时出错,eclipse,selenium-webdriver,maven-2,Eclipse,Selenium Webdriver,Maven 2,我在maven项目中有一个自动化的selenium脚本,用于执行某些功能。问题是当我用eclipse使用Testng触发它时, 它失败了,eclipse给我带来了一些错误,我无法重新爱上它。 我已附上错误跟踪。org.openqa.selenium.TimeoutException:预期条件失败:等待位于以下位置的元素的存在:by.xpath://*[text()='com.prism.soap.sftp.msg.mping.iflow']/../../../..//div[@class='On

我在maven项目中有一个自动化的selenium脚本,用于执行某些功能。问题是当我用eclipse使用Testng触发它时, 它失败了,eclipse给我带来了一些错误,我无法重新爱上它。 我已附上错误跟踪。
org.openqa.selenium.TimeoutException:预期条件失败:等待位于以下位置的元素的存在:by.xpath://*[text()='com.prism.soap.sftp.msg.mping.iflow']/../../../..//div[@class='OneByOne-sapMGTHdrContent'](每隔2秒尝试25秒)
位于org.openqa.selenium.support.ui.FluentWait.timeoutException(FluentWait.java:264)
位于org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:232)
位于com.webui.Others.webui.tooling.Prism\u Master\u Class.webdriver\u wait(Prism\u Master\u Class.java:47)
位于com.webui.Monitor.automation.Prism\u Selenium\u Monitor\u Tab.Prism\u Monitor\u messageProcessing(Prism\u Selenium\u Monitor\u Tab.java:732)
位于com.webui.Others.webui.tooling.Message\u Processing\u Vaidation.messageProcessingCheck(Message\u Processing\u Vaidation.java:21)
在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处
位于sun.reflect.NativeMethodAccessorImpl.invoke(未知源)
在sun.reflect.DelegatingMethodAccessorImpl.invoke处(未知源)
位于java.lang.reflect.Method.invoke(未知源)
位于org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
位于org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
位于org.testng.internal.Invoker.invokeTestMethod(Invoker.java:816)
位于org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1124)
位于org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
位于org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
位于org.testng.TestRunner.privateRun(TestRunner.java:774)
位于org.testng.TestRunner.run(TestRunner.java:624)
位于org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
在org.testng.SuiteRunner.runsequential上(SuiteRunner.java:354)
位于org.testng.SuiteRunner.privateRun(SuiteRunner.java:312)
运行(SuiteRunner.java:261)
位于org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
位于org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
在org.testng.testng.runSuitesSequentially上(testng.java:1215)
位于org.testng.testng.runSuitesLocally(testng.java:1140)
位于org.testng.testng.run(testng.java:1048)
位于org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
位于org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
位于org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)
原因:org.openqa.selenium.NoSuchElementException:无法使用by.xpath://*[text()='com.prism.soap.sftp.msg.mping.iflow']/../../../../../..//div[@class='OneByOne sapMGTHdrContent']
有关此错误的文档,请访问:http://seleniumhq.org/exceptions/no_such_element.html
生成信息:版本:“3.4.0”,版本:“未知”,时间:“未知”
系统信息:主机:'INLN50942827A',ip:'10.53.219.90',os.name:'Windows 10',os.arch:'amd64',os.version:'10.0',java.version:'1.8.0131'
驱动程序信息:驱动程序。版本:未知
位于org.openqa.selenium.support.ui.ExpectedConditions.lambda$findElement$0(ExpectedConditions.java:883)
位于java.util.Optional.orelsetrow(未知源)
位于org.openqa.selenium.support.ui.ExpectedConditions.findElement(ExpectedConditions.java:882)
位于org.openqa.selenium.support.ui.ExpectedConditions.access$000(ExpectedConditions.java:44)
位于org.openqa.selenium.support.ui.ExpectedConditions$6.apply(ExpectedConditions.java:183)
位于org.openqa.selenium.support.ui.ExpectedConditions$6.apply(ExpectedConditions.java:180)
位于org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:209)
... 还有27个

由于使用定位码找不到元素,您的错误似乎出现了,它被称为NoTouchElementException。再次检查您的代码。

您的错误读取为
NoTouchElementException
,这在findElement无法找到您要查找的实际WebElement时是可能的。