Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
attachFile does not work with PhantomJS #1823
changed the title from
attachFile does not work with PhatomJS
attachFile does not work with PhantomJS
Apr 1, 2015
@schmitzc what's the error your getting? I'm running PhantomJs also. Mine is:
Thank you @Naktibalda .
In order to provide more info:
Going back for Selenium, yes it works... but that does fix the issue with PhantomJS.
When LocalFileDetector is used, WebDriver uploads file to remote instance of Selenium or PhantomJS,
File upload to PhantomJS is broken, so we have to use UselessFileDetector,
Codecetion doesn't know if remote instance is PhantomJS so we can't do something like
The simplest solution I can image is
Have you got any better ideas?
Actually, we can do it like:
I think we need to have such detection, probably there will be a need for other phantom-specific patches.
I haven't had time to test it, but I want to make a note that browser setting has no effect on phantomjs, so the users will have to set it specifically to avoid this file upload issue.
When I tested phantomjs, I ran tests with
WebDriver module documentation does not tell to set
Yes, that's what I'm aiming for at the moment. I will also need to update docs.
That's not what he suggested. Please get the latest release from 2.1 branch and change your browser to
Updated docs, and more importantly added PhantomJS to our CI suite! https://semaphoreci.com/codeception/codeception/branches/2-1
Looks almost ready for a new release
referenced this issue
Feb 21, 2017
anyone looking to do this in Laravel Dusk
$file_input = $browser->driver->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('.input-image > input')); $file_input->setFileDetector(new \Facebook\WebDriver\Remote\LocalFileDetector()); $file_input->sendKeys(__DIR__.'/images/logo.png');