Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Safari-Driver or Equivalent not working in Windows 7 #4069

Closed
lukeis opened this issue Mar 3, 2016 · 17 comments
Closed

Safari-Driver or Equivalent not working in Windows 7 #4069

lukeis opened this issue Mar 3, 2016 · 17 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 3, 2016

Originally reported on Google Code with ID 4069


What steps will reproduce the problem?
1. Install Safari from Apple site for Windows - version 5.1.7
2. Install the latest selenium-webdriver for windows - version 2.22.2
3. Try b = Watir::Browser.new :safari in IRB and we get a safari window with the following
message "SafariDriver requesting connection at ws://127.0.0.1:53945/wd" (the port changes
on every launch)
4. IRB is now stuck (on both cmd and git-bash).. cannot enter any new lines. Also does
not function for scripts when run from command line.

What is the expected output? What do you see instead?

b.goto "wair.com" should be something I should be allowed to enter. Instead, text prompt
does not allow any entry.

Selenium version:
OS: Windows 7 Home Premium
Browser: Safari 
Browser version: 5.1.7

The exact same version of selenium-webdriver runs safari just fine in Mac OSX Lion.
What do I need to do for windows?

Reported by sambehera on 2012-06-12 03:30:35

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by barancev on 2012-06-12 13:25:07

  • Labels added: Component-WebDriver, Browser-Safari

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

It would be good to try and see if exact config also works under Windows XP. And also,
are we talking Windows 7 32-bit or Windows 7 64-bit?

Just asking these to help narrow down the issue.

Reported by mangaroo on 2012-06-22 23:13:00

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Having the same problem with selenium 2.24.1 on Windows7. Is there any workarounds for
this issue?

Reported by bleestka on 2012-06-26 10:10:22

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

For Windows 7, maybe use the XP mode options (XP mode compatibility OR use the free
XP virtual machine that you can get with Windows 7, then install/run Safari there).
And for XP VM route, can then either run SafariDriver code/test within XP, or run code
in Windows 7 using RemoteWebDriver requesting Safari Windows against XP VM "host".

Reported by mangaroo on 2012-07-01 05:32:28

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Issue 4012 has been merged into this issue.

Reported by jmleyba on 2012-07-17 16:06:20

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Did you mean that there is no better solution in Windows 7 and SafariDriver currently?

Reported by malexiaofei on 2012-07-26 06:22:14

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I was just able to run the SafariDriver on Windows 7 without any trouble.  This was
at r17853.

Reported by jmleyba on 2012-09-24 01:40:14

  • Status changed: WorkingAsIntended
  • Labels removed: Status-Untriaged

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Hi,
I'm not able to launch the safari driver in win 7 64 bit machine. I created apple developer
certificate and installed the safari extension without any issues in my machine. But
while launching the driver, Browser is not opening...I'm using Selenium java...

Just getting the below log info while executing the below code
driver = new SafariDriver();
driver.get("http://www.google.com");

Dec 15, 2012 1:36:34 PM org.openqa.selenium.safari.SafariDriverServer start
INFO: Server started at http://LNGDAYV-0001114:23907/

Could any one help please help me to fix this issue?

Reported by rameshnss on 2012-12-15 18:47:02

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Might depend on specific environment as well, perhaps Windows 7 64-bit.

I just tested SafariDriver v2.28 on Windows 7 Enterprise 32-bit and it works fine.

I don't have a 64-bit machine or other Windows 7 versions to play with. It would be
useful if the community can help narrow down the issue to what version of Windows 7
might have this problem (if it turns out to be against a specific version). As a baseline,
perhaps test with v2.28 since I tested with that.

Reported by mangaroo on 2012-12-15 23:13:37

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I have Win7 64-bit and it works fine.

Reported by jmleyba on 2012-12-17 19:22:05

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I wonder if it has anything to do with Safari version on Windows as well, unless there
is only 1 version of Safari 5 on Windows. Maybe not, but just bringing up possibilities.

I tested with Safari 5.1 (7534.50) on Windows 7 32-bit, and Safari 5.1.5 (7534.55.3)
on Windows XP SP3.

One user I talked with had issues and he was using Safari 5.1.7 (7534.57.2) on Windows
7 Enterprise 32-bit, using JRE 1.6.0_29-b11.

Reported by mangaroo on 2012-12-17 19:45:40

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Forgot to mention that the user I mentioned also tried my compiled extension (using
my certificate), which worked for me, but not for him. So one can factor out the "compilation
problem" from this, because if an extension works on 1 machine, it ideally should work
on all machines.

Reported by mangaroo on 2012-12-17 19:48:24

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Could any one tell me the solution for my problem....
I'm not able to install developer certificate  in different user account for my Win7
machine.. In my user account everything installed successful and selenium scripts are
working...I want to execute the same scripts in different user account in same machine.
Please let me know the procedure to setup safari driver. 

Can I use same certificate which i used for my user account?
Do I need to create new certificate with same apple ID or different Apple ID? 

Reported by rameshnss on 2012-12-18 21:44:18

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

You need one unique certificate per machine you compile SafariDriver extension on. Not
sure if you need one per account on same machine, but definitely one per machine at
least. And Apple only allows a max of 2 certificates per developer account, so bear
that in mind.

However, you only need the Apple certificate to compile the extension. Once compiled,
you can deploy the extension to as many machines as you like (internally in your organization
anyways).

What is not well documented on SafariDriver wiki page of the Selenium project and associated
blogs is how to compile and distribute your extensions.

All the wiki/blog posts only tell you to click "install" in extension builder to install
your extension on the local machine once you have all the other steps done.

To really build it and distribute the extension (internally), choose/click the other
option "Build Package..." button instead, which will give you a file browse dialog
to save an output file of the form "filename.safariextz" or so. This is the final Safari
extension binary installer file signed with your Apple developer certificate. You can
now distribute this SafariDriver and install it to any machine you want, with no need
to install an Apple certificate on the machine. Installing it means you "trust" the
application or developer who built it (with their certificate), but since you built
it, you should trust it right?

Do keep in mind to archive the binary installer that you build because Apple Safari
has a quirk in that when you run the installer, it delete the installer file, so if
you only have 1 copy, you need to build it again to get back the file, so easier to
archive a copy after building it.

See this screenshot for reference to the build package button
http://rationaleemotions.files.wordpress.com/2012/05/extnbuilder3.png?w=750

and on steps to use and install with the binary installer, see my how to 

https://docs.google.com/file/d/0B5KGduKl6s6-YjZILWd1WEJMRUU/edit

Reported by mangaroo on 2012-12-19 01:43:11

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Yes, the docs are out of date for handling the extension.

You can build the extension once (in the Extension Builder, select the WebDriver extension
and click "Build Package ...").

This will generate a SafariDriver.safariextz file.  You can install this on Safari
for multiple machines.  Alternatively, just drop the extension on the machine and run
the Selenium server with:

java -jar -Dwebdriver.safari.driver=/path/to/SafariDriver.safariextz selenium-server.jar

WebDriver will take care of the rest after that. I'm probably going to start bundling
the SafariDriver with the Selenium server (like we do for Firefox) in the 2.29 release.

Reported by jmleyba on 2012-12-19 22:54:43

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Jason,

When you say start bundling SafariDriver with server for next release, what do you
mean by that specifically?

You're not implying bundling a binary SafariDriver.safariextz into the server JAR so
it will auto install the driver extension to Safari on Selenium test runtime (and uninstall
after?), and to which it would mean we don't need to compile the extension ourselves
anymore?

Because if so, I thought the Selenium team had issue with how to get a project/group
Apple certificate to officially compile and distribute the extension, which I haven't
heard of being resolved yet.

Reported by mangaroo on 2012-12-20 01:10:32

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by luke.semerau on 2015-09-17 18:15:39

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 3, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant