Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I am trying to run safaridriver to automate google page as given in https://code.google.com/p/selenium/wiki/SafariDriver But what I can find is driver open the url and loads the home page, but after that the driver is not responding and webdriver is timing out.

Lines of code that are executing:

driver.get("http://www.google.com");
System.out.println(driver.getTitle());
driver.findElement(By.name("q")).sendKeys("webdriver");
//driver.findElement(By.id("gbqfq")).sendKeys("webdriver")

I am getting console out put :

Jun 27, 2012 10:06:33 AM org.openqa.selenium.safari.SafariDriverServer start INFO: Server started at Jun 27, 2012 10:06:38 AM org.openqa.selenium.safari.SafariDriverWebSocketHandler onOpen INFO: Connection opened Jun 27, 2012 10:06:39 AM org.openqa.selenium.safari.SafariDriverWebSocketHandler onMessage INFO: Received message: {"status":0,"value":{"browserName":"safari","version":"","platform":"MAC","javascriptEnabled":true,"takesScreenshot":true,"cssSelectorsEnabled":true},"id":"78f7f1aa-8d4d-4d6b-8cc4-a58eb96bf3e2"} Jun 27, 2012 10:06:39 AM org.openqa.selenium.safari.SafariDriverConnection onMessage INFO: Processing message: {"status":0,"value":{"browserName":"safari","version":"","platform":"MAC","javascriptEnabled":true,"takesScreenshot":true,"cssSelectorsEnabled":true},"id":"78f7f1aa-8d4d-4d6b-8cc4-a58eb96bf3e2"} Jun 27, 2012 10:09:39 AM org.openqa.selenium.safari.SafariDriverServer stop INFO: Stopping server Jun 27, 2012 10:09:39 AM org.openqa.selenium.safari.SafariDriverWebSocketHandler onClose INFO: Connection closed

How can I get back the driver control and resume the rest of execution from line System.out.println(driver.getTitle());?

share|improve this question
    
Rakesh - What happens if you comment out the System.out.println(driver.getTitle());? Does the rest of the code execute? –  Dan Snell Jun 27 '12 at 22:13
    
@DanSnell, No nothing executes after .get() opens the urls. Its like no response comes to webdriver after driver.get() executes. I tried giving different commands after driver.get(). –  Rakesh Prabhakaran Jun 28 '12 at 4:31
    
As i opened the web inspector and checked in console. It was saying command inactive after opening url. Also I tried with different websites or urls. –  Rakesh Prabhakaran Jun 28 '12 at 4:32
    
Its working now, was a mistake on my part. –  Rakesh Prabhakaran Jun 28 '12 at 9:23
    
Rakesh - Great to hear you got it working. Could you post your resolution below so that if other folks run into a similar problem they might be able to use what you figured out to resolve their issue? –  Dan Snell Jun 28 '12 at 16:19
show 1 more comment

1 Answer 1

up vote 0 down vote accepted

It's working now. I had problem with Selenium standalone server jars. I just created new Safari extension with latest code and used Selenium standalone server 2.24. Now it is working fine, I believe it was some version issue.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.