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

Unable to upload file using attachfile function when remote is Phantomjs #4024

Closed
samiullah opened this issue Feb 21, 2017 · 7 comments
Closed

Comments

@samiullah
Copy link

What are you trying to achieve?

I am trying to upload a file using attachFile function. I have Phantomjs remote.

What do you get instead?

I am not able to see file getting upload in screenshot

Provide console output if related. Use -vvv mode for more details.

# paste output here

Provide test source code if related

// paste test

Details

  • Codeception version:
  • PHP Version:
  • Operating System:
  • Installation type: Phar || Composer
  • List of installed packages (composer show)
  • Suite configuration:
# paste suite config here
@Naktibalda
Copy link
Member

Have you set browser: phantomjs in WebDriver configuration?

@Naktibalda
Copy link
Member

Related issue #1823

browser: phantomjs fixes file uploads when PhantomJS is running on the same machine, you may need to remove it to make file uploads work with remote PhantomJS.

@heykarthikwithu
Copy link

heykarthikwithu commented Feb 21, 2017

i have codeception version 2.2.4

i have commented $el->setFileDetector(new \LocalFileDetector);
but was facing error with

 [Facebook\WebDriver\Exception\WebDriverException] JSON decoding of remote response failed.
Error code: 4

@Naktibalda
Copy link
Member

You need LocalFileDetector to upload file to remote PhantonJS.
UselessFileDetector only works with local PhantomJS.

@Naktibalda
Copy link
Member

Please let us know if you managed to solve this issue.

@heykarthikwithu
Copy link

Actually @Naktibalda i want to mention one more point here...

we were able to do file upload with phanomjs which is running locally,
we aren't able to do file upload with Remote phantomjs... which is running in the different instance..

@Naktibalda
Copy link
Member

It is an issue of PhantonJS: ariya/phantomjs#13302 (comment)

If your PhantomJS actually runs on a different machine, regardless of which remote driver you use you need to make sure that the files are actually available on the remote server on the path that you are sending.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants