rahu28 / js-test-driver

Automatically exported from code.google.com/p/js-test-driver
0 stars 0 forks source link

Browser Capture/Auto Startup Failing for Safari #97

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. run the command: java -jar JsTestDriver-1.2.jar --port 9876 --browser
/Applications/Safari.app/Contents/MacOS/Safari

What is the expected output? What do you see instead?
Expect browser to start, and open http://localhost:9876/capture

instead goes to file system:
file:///Users/[user]/[directory]/http:/127.0.0.1:9876/capture
(where [directory] is the same directory from step 1)

What version of the product are you using? On what operating system?
JsTestDriver-1.2.jar
OS X 10.6.2
Safari 4.0.3, 

Please provide any additional information below.

Original issue reported on code.google.com by georgeam...@gmail.com on 27 Jan 2010 at 8:39

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
On my OS X 10.6 system, this command-line invocation will open a Safari browser 
with given URL:

open -a Safari http://localhost:9876/capture

Original comment by olle.jonsson on 26 Mar 2010 at 8:43

GoogleCodeExporter commented 8 years ago
I have the same problem on OS X 10.6.6, using JsTestDriver-1.2.2.jar and Safari 
5.0.3

Original comment by jeremypi...@gmail.com on 26 Jan 2011 at 4:51

GoogleCodeExporter commented 8 years ago
I'm running into the same problem as well. Here's the breakdown:

- JSTestDriver 1.3.1
- OS X 10.6.4
- Safari 5.0.2

Original comment by uk.subhuman@gmail.com on 2 Mar 2011 at 12:35

GoogleCodeExporter commented 8 years ago
I also have this issue:

- JSTestDriver 1.3.2
- OS X 10.6.6
- Safari 5.0.4

I'm also having issues where browser don't open because the profile isn't 
loading with the browser. Opera will ask me how I want to open the browser as 
default.

Original comment by xalteds...@gmail.com on 22 Aug 2011 at 6:31

GoogleCodeExporter commented 8 years ago
Due to the constraints that starting command line browsers on a Mac, the only 
workaround is to set the browser you wish to automatically start as the default 
browser and pass "open" as the command.

Looking to workarounds, but a moderately non-trivial problem that has existed 
since the beginning. :p

Original comment by corbinrs...@gmail.com on 22 Aug 2011 at 6:47

GoogleCodeExporter commented 8 years ago
I have a workaround for Safari. Instead of having jstd start safari directly, I 
created a simple script to do the job:

-----
#!/bin/bash
trap "{ killall Safari; rm -rf ~/Library/Saved\ Application\ 
State/com.apple.Safari.savedState/; exit 0; }" EXIT
open -a Safari -W $1
-----

save this as safari.sh and configure --browser to execute safari.sh.

Note that the script will kill *all* safari processes for the current process 
once the jstd tries to kill safari.sh. 

Because I'm on Lion, I'm also deleting safari's saved app state (resume state), 
because otherwise the next time jstd runs, safari resumes all windows from the 
previous test run which interfere with the current run.

Original comment by imi...@google.com on 27 Aug 2011 at 12:24

GoogleCodeExporter commented 8 years ago
Issue 253 has been merged into this issue.

Original comment by corbinrs...@gmail.com on 28 Dec 2011 at 9:19

GoogleCodeExporter commented 8 years ago
Since fixing this screws up advanced users from being able to use shell 
scripts, this won't be fixed. Investigating other browser provisioning 
methodologies.

Original comment by corbinrs...@gmail.com on 7 Jun 2012 at 10:19

GoogleCodeExporter commented 8 years ago
I am facing the same issue. How did you configure your --browser to run a shell 
script?
If I try to run --browser safari.sh I get this error 
java.util.concurrent.ExecutionException. Cannot run program safari.sh. error=2, 
No such file or directory. I get this error even I provide absolute path to the 
.sh file.

Original comment by masumafa...@gmail.com on 24 Jun 2014 at 6:55