Git Product home page Git Product logo

arquillian-phantom-driver's People

Contributors

abrin avatar and-k avatar denisa avatar kpiwko avatar matousjobanek avatar michbeck100 avatar papousek avatar ppitonak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

arquillian-phantom-driver's Issues

Does not support path names with spaces

FileUtils::setExecutable does not work properly with a path name that has spaces since the path is not quoted in the exec command.

An alternative cross-platform fix, given that the File object is already available, would be to call File.setExecutable(true)

Request new release to include recent windows fix

Hi

Apologies if this is the wrong place to make this request, but I couldn't see an obvious mailing list specific to this project.

I'd like to make use Arquillian Phantom Driver in a public project, but as a Windows user I'm running in to the bug that was fixed with 02534e7.

Would it be possible to release & deploy a new version that includes this fix?

Thanks

Andy

PHANTOMJS_RESOURCE hardcoded, 1.9.8 not working

With older 1.9.x versions of PhantomJS, the binary is NOT inside some "BIN"-folder within the JAR-archive.

Stacktrace:

java.io.FileNotFoundException: cannot find file: bin/phantomjs.exe in archive: C:\Users\someuser\.m2\repository\org\jboss\arquillian\extension\arquillian-phantom-binary\1.9.8\arquillian-phantom-binary-1.9.8-windows.jar
	at org.jboss.arquillian.phantom.resolver.FileUtils.extract(FileUtils.java:38)
	at org.jboss.arquillian.phantom.resolver.maven.MavenPhantomJSBinaryResolver.resolveFreshExtracted(MavenPhantomJSBinaryResolver.java:70)
	at org.jboss.arquillian.phantom.resolver.maven.MavenPhantomJSBinaryResolver.resolve(MavenPhantomJSBinaryResolver.java:56)
	at org.jboss.arquillian.phantom.resolver.ResolvingPhantomJSDriverService.resolveBinary(ResolvingPhantomJSDriverService.java:99)
	at org.jboss.arquillian.phantom.resolver.ResolvingPhantomJSDriverService.createDefaultService(ResolvingPhantomJSDriverService.java:52)

How can PHANTOMJS_RESOURCE be overridden/changed? Do I need to use an older version of arquillian-phantom-driver for using older phantomjs-versions?

PhantomJS configuration is not customizable via Capabilities/arquillian.xml

In theory the MavenPhantomJSBinaryResolver supports configuring the PhantomJS version via "phantomjs.binary.version", but this only works if the version has been set as a system property, but not via a Capabilities object (which is also created from the arquillian.xml descriptor).
It can be fixed by passing the Capabilities object to the ResolverConfiguration.get() invokation (line 68 on current master).

Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

I'm using arquillian-phantom-driver ver. 1.1.0.Final. My tests pass on Linux, but fail on Windows during initializing driver. I noticed that on Windows phantomjs binary is started to be downloaded, but the size stays 0 until the test stops and binary is deleted.

Tested this on 2 Linux and 3 Windows systems, same behavior occurs for each Linux(success) / Windows (fail)

Here is my setUp method:

    public void setUp() throws Exception {

    println("> setup started")

    println("  > setting capabilities...")
    def capabilities = DesiredCapabilities.phantomjs()

    // Turn off SSL validation: disable "web-security", enable all possible "ssl-protocols"
    // and "ignore-ssl-errors" for PhantomJSDriver
    println("  > setting PhantomJS client arguments...")
    ArrayList<String> cliArgs = new ArrayList<String>()
    cliArgs.add("--web-security=false")
    cliArgs.add("--ssl-protocol=any")
    cliArgs.add("--ignore-ssl-errors=true")
    cliArgs.add("--webdriver-loglevel=INFO")

    capabilities.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, cliArgs)

    println("  > creating service...")
    def service = ResolvingPhantomJSDriverService.createDefaultService(capabilities)

    println("  > initializing driver...")
    driver = new PhantomJSDriver(service, capabilities)

    }

Linux:
[root@test ~]# java -version
java version "1.7.0_25"
OpenJDK Runtime Environment (rhel-2.3.10.4.el6_4-x86_64)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

[root@test ~]# uname -m
x86_64

Windows:
D:\Projects\test>java -version
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) Client VM (build 24.0-b56, mixed mode, sharing)

32-bit Operating System

Tests fail after upgrade to PhantomJS 1.9.6 / GhostDriver 1.1.0

PhantomJS is launching GhostDriver...
[INFO  - 2014-01-24T10:11:03.778Z] GhostDriver - Main - running on port 21454
[ERROR - 2014-01-24T10:11:04.206Z] RouterReqHand - _handle.error - {"message":"Cannot find module 'cookiejar'","line":289,"sourceId":139708068089792,"sourceURL":"phantomjs://bootstrap.js","stack":"Error: Cannot find module 'cookiejar'\n    at phantomjs://bootstrap.js:289\n    at require (phantomjs://bootstrap.js:254)\n    at :/ghostdriver/session.js:104\n    at :/ghostdriver/request_handlers/session_manager_request_handler.js:75\n    at :/ghostdriver/request_handlers/session_maTests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 2.17 sec <<< FAILURE! - in org.jboss.arquillian.phantom.resolver.TestDriver
testSimpleWithPath(org.jboss.arquillian.phantom.resolver.TestDriver)  Time elapsed: 1.274 sec  <<< ERROR!
org.openqa.selenium.UnsupportedCommandException: Error - Cannot find module 'cookiejar'
Command duration or timeout: 679 milliseconds
Build info: version: '2.39.0', revision: '14fa800511cc5d66d426e08b0b2ab926c7ed7398', time: '2013-12-16 13:18:38'
System info: host: 'localhost.localdomain', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.12.7-300.fc20.x86_64', java.version: '1.7.0_45'
Driver info: org.openqa.selenium.phantomjs.PhantomJSDriver
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:216)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:111)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:115)
    at org.openqa.selenium.phantomjs.PhantomJSDriver.<init>(PhantomJSDriver.java:110)
    at org.jboss.arquillian.phantom.resolver.TestDriver.testSimpleWithPath(TestDriver.java:36)

testSimple(org.jboss.arquillian.phantom.resolver.TestDriver)  Time elapsed: 0.893 sec  <<< ERROR!
org.openqa.selenium.UnsupportedCommandException: Error - Cannot find module 'cookiejar'
Command duration or timeout: 515 milliseconds
Build info: version: '2.39.0', revision: '14fa800511cc5d66d426e08b0b2ab926c7ed7398', time: '2013-12-16 13:18:38'
System info: host: 'localhost.localdomain', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.12.7-300.fc20.x86_64', java.version: '1.7.0_45'
Driver info: org.openqa.selenium.phantomjs.PhantomJSDriver
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:216)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:111)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:115)
    at org.openqa.selenium.phantomjs.PhantomJSDriver.<init>(PhantomJSDriver.java:110)
    at org.jboss.arquillian.phantom.resolver.TestDriver.testSimple(TestDriver.java:21)

nager_request_handler.js:44\n    at :/ghostdriver/request_handlers/router_request_handler.js:70","stackArray":[{"sourceURL":"phantomjs://bootstrap.js","line":289},{"function":"require","sourceURL":"phantomjs://bootstrap.js","line":254},{"sourceURL":":/ghostdriver/session.js","line":104},{"sourceURL":":/ghostdriver/request_handlers/session_manager_request_handler.js","line":75},{"sourceURL":":/ghostdriver/request_handlers/session_manager_request_handler.js","line":44},{"sourceURL":":/ghostdriver/request_handlers/router_request_handler.js","line":70}]}

Not working on MacBook

Tried to use on a macbook pro, but found 2 problems:

  1. Failure to find org.jboss.arquillian.extension:arquillian-phantom binary:jar:unix_x86_64:1.9.0, the reason is that on the mac ${os.arch} evaluates to x86_64.
  2. Could go around 1) by adding -Dos.arch=mac, but then the unpacked phantomjs is not executable.

instructions on README may not always work

I spent quite a while debugging an issue when trying to pass parameters into phantomJS. The root of the issue is that this didn't work:

WebDriver driver = new PhantomJSDriver(
        ResolvingPhantomJSDriverService.createDefaultService(),
        capabilities);

The following was the issue, the ResolvingPhantomJSDriverService needed to be configured with the capabilities. (see line 173). This is specifically the case when you need to configure the driver with CommandLineArguments. The following works:

WebDriver driver = new PhantomJSDriver(
        ResolvingPhantomJSDriverService.createDefaultService(capabilities),
        capabilities);

phantomjs lookup mechanism does not work always

I use the arquillian-phantom-binary in a servlet container and had lots of trouble with resolving the included phantomjs binary - it didn't work.

A working solution was to put the binaries as resources into the JAR and using something like "getClass().getResource(...)" to access the binary. Additionally the current implementation can't cope with blanks in the binary URL because the URL.file is not URLDecoded.

Please see https://bitbucket.org/empulse/selenium-phantomjs-driver-clone/overview for a possible solution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.