Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari webdriver extension 2.48 not running with Safari 9 #1185

Closed
Merfar opened this issue Oct 22, 2015 · 29 comments
Closed

Safari webdriver extension 2.48 not running with Safari 9 #1185

Merfar opened this issue Oct 22, 2015 · 29 comments

Comments

@Merfar
Copy link

@Merfar Merfar commented Oct 22, 2015

Hello,

i need some support. Yesterday i updating my macbook to el capitan. In this case i updating may Safari from version 8 to 9 as well. I have writing some testscripts. The problem is, the safari browser will opened but not not call the the desired URL.Safari Browser stops.

System information:
selenium 2.48.2
safari 9.0
TestNG 6.9.6
safari extension 2.48

error trace:

java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;
at org.openqa.selenium.safari.WebSocketConnection.send(WebSocketConnection.java:139)
at org.openqa.selenium.safari.SafariDriverCommandExecutor.execute(SafariDriverCommandExecutor.java:188)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:620)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:129)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142)
at org.openqa.selenium.safari.SafariDriver.(SafariDriver.java:62)
at org.openqa.selenium.safari.SafariDriver.(SafariDriver.java:42)
at de.softisticated.testautomatisierung.base.AbstractTest.readProperties(AbstractTest.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:170)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:104)
at org.testng.TestRunner.privateRun(TestRunner.java:773)
at org.testng.TestRunner.run(TestRunner.java:623)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
at org.testng.SuiteRunner.run(SuiteRunner.java:259)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
at org.testng.TestNG.run(TestNG.java:1018)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

Does somebody has any idea? Thank you.

@Merfar
Copy link
Author

@Merfar Merfar commented Oct 22, 2015

bildschirmfoto 2015-10-22 um 09 14 42
bildschirmfoto 2015-10-22 um 09 15 01

@uchuugaka
Copy link

@uchuugaka uchuugaka commented Oct 22, 2015

The Java WebDriver for Safari fails if Safari is already open or has a window open already. It is good to ensure this is the case and that you do not have anything set to restore windows or anything from the previous Safari session.

@uchuugaka
Copy link

@uchuugaka uchuugaka commented Oct 22, 2015

This was tripping me up about a week ago and behaves quite differently from other implementations. Ruby Selenium for Safari does not have that problem. There are some deficiencies with the Java Selenium for Safari (and consequently the Python one which just calls the Java... )

@Merfar
Copy link
Author

@Merfar Merfar commented Oct 22, 2015

Hello uchuugaka,

there is no safari window open before and i perform no restore function. What i can do, i dont get any further

@Merfar
Copy link
Author

@Merfar Merfar commented Oct 22, 2015

@BerforeClass
@parameters({ "host" })

this.driver = new SafariDriver();
this.utils = new Utils(this.driver);
driver.get(host);
driver.manage().window().setSize(new Dimension(1024, 850));
if (!utils.getDriver().getTitle().contains("XXXXXXX")) {
Reporter.log("Browser not ready yet => refresh");
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
}
utils.getDriver().navigate().refresh();
}
}

variable host will come from the testng.xml
host = http://192.168.2.1

@msiles
Copy link

@msiles msiles commented Oct 26, 2015

I tried on Mac 10.11, Safari Version 9.0 (11601.1.56), Webdriver 2.48 and it starts fine....

@Merfar
Copy link
Author

@Merfar Merfar commented Oct 27, 2015

@msiles
hi mslies,
that is strange! I think you use some other configurations like me. So i would like send you a small video, that shows my problem. My Webdriver starts as well, but the webdriver not continue, it stops. You can see this in the attachments, which i post in my issue.

@msiles
Copy link

@msiles msiles commented Oct 28, 2015

@Merfar did you already download the Webdriver extension and put enable the option in Safari?

http://selenium-release.storage.googleapis.com/index.html?path=2.48/

Download the SafariDriver.safariextz

@Merfar
Copy link
Author

@Merfar Merfar commented Oct 28, 2015

yes, exactly from the url, which you did mentioned.If i not install the extension, i will get a error.

@uchuugaka
Copy link

@uchuugaka uchuugaka commented Oct 28, 2015

@Merfar
Does an older version than 2.48 work for you?

On Oct 28, 2015, at 11:25 PM, Merfar notifications@github.com wrote:

yes, exactly from the url, which you did mentioned.


Reply to this email directly or view it on GitHub.

@Merfar
Copy link
Author

@Merfar Merfar commented Oct 28, 2015

@uchuugaka
i tried with the version 2.45 as well,this fails,too.

@redbiscuit
Copy link

@redbiscuit redbiscuit commented Nov 1, 2015

I met the same issue

@msiles
Copy link

@msiles msiles commented Nov 1, 2015

are you running this on mac or windows?

On Sat, Oct 31, 2015 at 8:54 PM, Jerry_Bian notifications@github.com
wrote:

I met the same issue


Reply to this email directly or view it on GitHub
#1185 (comment)
.

@uchuugaka
Copy link

@uchuugaka uchuugaka commented Nov 1, 2015

I sure hope it's on OS X because Safari for Windows was end of lifed some time ago.

On Nov 1, 2015, at 1:49 PM, msiles notifications@github.com wrote:

are you running this on mac or windows?

On Sat, Oct 31, 2015 at 8:54 PM, Jerry_Bian notifications@github.com
wrote:

I met the same issue


Reply to this email directly or view it on GitHub
#1185 (comment)
.


Reply to this email directly or view it on GitHub.

@redbiscuit
Copy link

@redbiscuit redbiscuit commented Nov 1, 2015

Running on MAC os 10.11.1 with safari 9.0.1
This error happens when try to create a new safariDriver()
Selenium-server-standalone-2.48.2.jar

@Merfar
Copy link
Author

@Merfar Merfar commented Nov 2, 2015

@redbiscuit
Did you get the same error logs from the safari driver like me? Please have a look on my screenshots.

@dirathea
Copy link

@dirathea dirathea commented Nov 17, 2015

Actually I'm experiencing the same problem, but it happen intermittently.
Mac OSX Yosemite, Selenium Java 2.48.2

@vvarduhi
Copy link

@vvarduhi vvarduhi commented Nov 18, 2015

I'm facing the same issue using Selenium Java 2.48.2 with Safari 9.0. However, facing with this non constantly.

@vshanve
Copy link

@vshanve vshanve commented Nov 19, 2015

I am facing similar issue on Mac OS X Yosemite 10.10.4 - Safari 8.0.7. Its working fine with selenium 2.45. After upgrading selenium jars to 2.48 I am seeing this issue.

@mdiwakar
Copy link

@mdiwakar mdiwakar commented Nov 20, 2015

Hi I am unable to install the Safari extension 2.48 http://selenium-release.storage.googleapis.com/index.html?path=2.48/ on Safari 9.0 El Capitan, it was working fine earlier however I see that after system upgraded to El Capitan version 10.11.1 I am unable to install it. I created Safari extension and installed it, however after few runs the installed webdriver extension gets uninstalled.

@leeyupeng
Copy link

@leeyupeng leeyupeng commented Nov 25, 2015

The root cause might be the conflict between 2 different versions loaded of dependency "com.google.guava" .

The method "com.google.common.util.concurrent.MoreExecutors.directExecutor" is available since version 18.0 from Guava which is Google Core Libraries For Java.
So if there is another version Guava which is below 18.0 in your java classpath, that might cause the problem, even make it intermittently.
Try to find the lower version Guava, delete, disable or skip it.

For example, if you are using maven, try to run the command to check the dependency tree related with Guava

mvn dependency:tree -Dverbose -Dincludes="com.google.guava"

If there is conflict information as below, you can delete your local repository and add "exclusions" tag in maven pom.xml to skip the conflict dependency.

... ...
 +- xxx.xxx-xxx.xxx:jar:X.X.0:compile

 |  \- com.google.guava:guava:jar:17.0:compile

 \- org.seleniumhq.selenium:selenium-java:jar:2.48.2:compile

    \- org.seleniumhq.selenium:selenium-chrome-driver:jar:2.48.2:compile

       \- org.seleniumhq.selenium:selenium-remote-driver:jar:2.48.2:compile

          +- org.seleniumhq.selenium:selenium-api:jar:2.48.2:compile

         |  \- (com.google.guava:guava:jar:18.0:compile - omitted for conflict with 17.0)

         \- (com.google.guava:guava:jar:18.0:compile - omitted for conflict with 17.0)
... ...

To skip the guava for the dependency xxx.xxx-xxx.xxx in pom.xml

<project>
  ...
  <dependencies>
    <dependency>
      <groupId>xxx.xxx</groupId>
      <artifactId>xxx.xxx</artifactId>
      <version>X.X.0</version>
      <exclusions>
        <exclusion>
          <groupId>com.google.guava</groupId>
          <artifactId>guava</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    ...
  </dependencies>
</project>
@dirathea
Copy link

@dirathea dirathea commented Nov 26, 2015

@lukeis hi Lukeis,
I've tried your suggestion, to remove duplicated guava library on my code.
I found it duplicate on opera driver and browsermob proxy. but the error still occur.

@Vanilton18
Copy link

@Vanilton18 Vanilton18 commented Dec 2, 2015

Thanks @leeyupeng for your comment, updated version of guava and it worked for me.

@cjamago
Copy link

@cjamago cjamago commented Jan 27, 2016

This was resolve by using
leeyupeng commented on 25 Nov 2015
I just com.google.guava dependency that is not below 18

@anthonygreen
Copy link

@anthonygreen anthonygreen commented Feb 29, 2016

Have these same issues using webdriver.js

@lukeis
Copy link
Member

@lukeis lukeis commented Sep 23, 2016

With the release of Safari 10, Apple now offers official support WebDriver. Because of this, the Selenium project no supports the legacy implementation from 2.x.

Users are advised to switch to Apple's driver and file bugs at
https://bugreport.apple.com/

We are no longer tracking issues for Selenium's SafariDriver and thus closing this issue.

@lukeis lukeis closed this Sep 23, 2016
@airtonix
Copy link

@airtonix airtonix commented Nov 3, 2016

so how do we run automated tests for safari 9 then?

@uchuugaka
Copy link

@uchuugaka uchuugaka commented Nov 3, 2016

Well using 2.x of course. It's not realistic for all users to be on latest or for all web apps to not support fairly recent browsers. Automation is exactly the right tool to help test multiple configurations, isn't it? 3.x is supposed to also work with an RFC spec that is still changing. Use what works.

On 4 Nov 2016, at 8:14, Zenobius Jiricek notifications@github.com wrote:

so how do we run automated tests for safari 9 then?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@uchuugaka
Copy link

@uchuugaka uchuugaka commented Nov 3, 2016

So, make sure you built the extension with a developer account that can code sign.
If not you have no extension.
If the OS version is too old, well, it may be impossible as code signing rules changed about a year ago requiring new certs be installed and rebuilds.

I build the extension every few months to ensure against this.

Personally, I stick to 2.47.1 as I haven’t found any particular changes in the extension itself since then. (there might be but I haven’t found it.)
I have also forked this branch to keep it and I recommend the same personally if you the native driver does not work for you.
At present, I need to test drag & drop actions and file download & upload. Native driver is too sandboxed.
“Legacy” driver doesn’t exactly support those, so I supplement with the native accessibility APIs to drive those and to handle alerts as well.

On 2015 Oct 22, at 17:02, Merfar notifications@github.com wrote:

Hello uchuugaka,

there is no safari window open before and i perform no restore function. What i can do, i dont get any further


Reply to this email directly or view it on GitHub #1185 (comment).

@lock lock bot locked and limited conversation to collaborators Aug 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.