我有下面的selenium脚本来启动一个URL,但是当我运行时总是会出错。我搜索了堆栈溢出和其他站点,但没有一个解决方案适合我。
解决方案尝试: 1.将所有安全值设置为相同级别(高) 2.启用或禁用所有安全设置。
代码:
onUploadComplete: function(oEvent) {
var oUploadCollection = oEvent.getSource();
oUploadCollection.setUploadUrl(null);
}
错误抛出:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class Automation{
static String driverPath = "IE driver path";
public WebDriver driver;
@BeforeClass
public void setUp() {
System.out.println("*******************");
System.out.println("launching IE browser");
System.setProperty("webdriver.ie.driver", ".\\ieDriver\\IEDriverServer.exe");
driver = new InternetExplorerDriver();
driver.manage().window().maximize();
}
@Test
public void testGooglePageTitleInIEBrowser() {
driver.navigate().to("http://www.google.com");
String strPageTitle = driver.getTitle();
System.out.println("Page title: - "+strPageTitle);
Assert.assertTrue(strPageTitle.equalsIgnoreCase("Google"), "Page title doesn't match");
}
@AfterClass
public void tearDown() {
if(driver!=null) {
System.out.println("Closing IE browser");
driver.quit();
}
}
}
答案 0 :(得分:0)
错误说明了一切:
Started InternetExplorerDriver server (32-bit)
3.9.0.0
org.openqa.selenium.remote.SessionNotFoundException: session null does not exist (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 23 milliseconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'BDC4-L-9XMLTF2', ip: '192.168.56.1', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
从您的错误堆栈跟踪中可以清楚地看到,新的会话未启动,并且驱动程序信息也未被识别。
您的主要问题是您使用的二进制文件之间的版本兼容性,如下所示:
因此 JDK v8u121 , Selenium Client v2.53.0 , ChromeDriver 版本( v2.36)之间明显不匹配)和 Chrome浏览器版本( v65.0 )
@Test
。