Codeception - File upload - Plupload

Created on 2 Jun 2017  Â·  6Comments  Â·  Source: Codeception/Codeception

What are you trying to achieve?

On my test I have to attache a file. But I can't use

$I->attachFile('input[@type="file"]', 'prices.xls');

What do you get instead?

Its use the "http://www.plupload.com/" and in the code generated you dont have input. Here the code generated

<a class="bnt plupload_button plupload_add needsclick  btn ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary" id="NkImportConfig_1_file-plupload-59319a0bd4215_browse" role="button" aria-disabled="false" style="z-index: 0;">
  <span class="ui-button-icon-primary ui-icon ui-icon-circle-plus"></span>
  <span class="ui-button-text">
    <span class="btn-register-txt  needsclick ">Sélectionnez le(s) fichier(s) sur votre ordinateur </span
  </span>
</a>

I try to use one of the following solution but I'm on an unix server
http://www.techbeamers.com/handle-file-upload-selenium-webdriver/

Furthermore I have to send my tests on sauce labs. So I have to send instructions via Selenium.

Do you have a solution ?
Thanks a lot

Details

  • Codeception version: 2.3
  • Selenium server : 3.4
  • PHP Version: 5.6
  • Operating System: Unix
  • Installation type: Composer Phar
  • Suite configuration: acceptance.suite.yml
class_name: AcceptanceTester
modules:
    enabled:
        - WebDriver
        - \Helper\Acceptance
    config:
        WebDriver:
            url: myurltotest
            clear_cookies: false
            window_size: 'maximize'
env:
    chrome:
         modules:
            config:
              WebDriver:
                browser: chrome
WebDriver question

Most helpful comment

If you can figure out how to do it with Selenium, I will tell you how to do it with Codeception.

All 6 comments

If you can figure out how to do it with Selenium, I will tell you how to do it with Codeception.

I listen to you

Let's move there http://phptest.club/t/codeception-file-upload-with-no-input-file-pupload-library/1524
It's not about Codeception it's about using Selenium and JavaScript library for uploads. Try to google Selenium + Plupload, as it was said If there will be a solution in any language we can help you to implement it in Codeception

Update
http://phptest.club/t/codeception-file-upload-with-no-input-file-pupload-library/1524/2

For the moment I don't find a valid php solution. It seems, I have to use
java robot
http://docs.oracle.com/javase/7/docs/api/java/awt/Robot.html

I keep looking !

2017-06-04 10:58 GMT+01:00 Michael Bodnarchuk notifications@github.com:

Closed #4296 https://github.com/Codeception/Codeception/issues/4296.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Codeception/Codeception/issues/4296#event-1109080150,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AP7WWWZw7K_Q_hNbsRXUuRkPkT9HeLxyks5sAn_SgaJpZM4NujZJ
.

--

Jacques Jähnichen

j.jahnichen(at)gmail(dot)com

+33 (0)7 82 34 03 85

Hello,

The solution was far more easy than my first hypothesis
http://phptest.club/t/codeception-file-upload-with-no-input-file-pupload-library/1524/2

Sorry for the lost time and thank you for your help,

2017-06-05 16:00 GMT+01:00 Jacques Jahnichen j.jahnichen@gmail.com:

Update
http://phptest.club/t/codeception-file-upload-with-
no-input-file-pupload-library/1524/2

For the moment I don't find a valid php solution. It seems, I have to use
java robot
http://docs.oracle.com/javase/7/docs/api/java/awt/Robot.html

I keep looking !

2017-06-04 10:58 GMT+01:00 Michael Bodnarchuk notifications@github.com:

Closed #4296 https://github.com/Codeception/Codeception/issues/4296.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Codeception/Codeception/issues/4296#event-1109080150,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AP7WWWZw7K_Q_hNbsRXUuRkPkT9HeLxyks5sAn_SgaJpZM4NujZJ
.

--

Jacques Jähnichen

j.jahnichen(at)gmail(dot)com

+33 (0)7 82 34 03 85

--

Jacques Jähnichen

j.jahnichen(at)gmail(dot)com

+33 (0)7 82 34 03 85

Adding the archived link for future reference:
https://web.archive.org/web/20180322213409/http://phptest.club/t/codeception-file-upload-with-no-input-file-pupload-library/1524/2

Was this page helpful?
0 / 5 - 0 ratings