Web驱动程序无法在Safari浏览器中打开应用程序

时间:2014-03-26 10:14:16

标签: java selenium safari selenium-webdriver

我尝试在Safari浏览器上运行测试。浏览器打开很好但无法启动应用程序。

Selenium Standalone版本:2.39.0
Safari - 5.1.7
操作系统 - Windows

用于启动的代码

WebDriver driver = new SafariDriver();
driver.get("some application url");

Safari窗口打开,显示以下消息

SafariDriver Client

[  0.504s] [safaridriver.client] Requesting connection at ws://localhost:7539...  
[  0.647s] [safaridriver.client] Request acknowledged; connecting...

记录:

Mar 26, 2014 2:56:05 PM org.openqa.selenium.safari.SafariDriverServer start
INFO: Server started on port 7539
Mar 26, 2014 2:56:07 PM org.openqa.selenium.safari.SafariDriverCommandExecutor start
INFO: Launching Safari
Mar 26, 2014 2:56:07 PM org.openqa.selenium.safari.SafariDriverCommandExecutor start
INFO: Waiting for SafariDriver to connect
Mar 26, 2014 2:56:13 PM org.openqa.selenium.safari.SafariDriverChannelHandler$1operationComplete
INFO: Connection opened
Mar 26, 2014 2:56:14 PM org.openqa.selenium.safari.SafariDriverCommandExecutor start
INFO: Driver connected in 6154 ms


org.openqa.selenium.NoSuchWindowException: The driver is not focused on a window. You  must switch to a window before proceeding. (WARNING: The server did not provide any     stacktrace information)
Command duration or timeout: 19 milliseconds
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:11:15'
System info: host: 'QA02', ip: '192.168.18.58', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_21'
Session ID: null
Driver info: org.openqa.selenium.safari.SafariDriver
Capabilities [{platform=WINDOWS, cssSelectorsEnabled=true, javascriptEnabled=true,  secureSsl=true, browserName=safari, takesScreenshot=true, version=5.1.7}]

请指导我如何解决问题

0 个答案:

没有答案