SeleniumGrid - file upload fails while running remotelyCreate and upload a file on selenium gridHow to avoid Java code in JSP files?Selenium 'ant run-demo-in-parallel' command failure?TimeOut issue and stale instances of webdriver after test failsRunning WebdriverJS test on Selenium GridSelenium tests fail on remote machine for chrome and ie driversSelenium grid execution - How to upload multiple files together(at one time) to webpage using sendkeysDoes the Selenium Chrome remote webdriver with mobile emulation support touch gestures?Has anyone used the Java robot class to execute keystrokes using remoteWebDriver on Selenium grid?Chrome driver is not able to pickup a file from the system when we run it through a ServiceHow to run testcafe from docker on remote selenium grid

Is divisi notation needed for brass or woodwind in an orchestra?

How do I lift the insulation blower into the attic?

Not hide and seek

Why do Radio Buttons not fill the entire outer circle?

What is this high flying aircraft over Pennsylvania?

Are hand made posters acceptable in Academia?

How can a new country break out from a developed country without war?

New Order #2: Turn My Way

What should be the ideal length of sentences in a blog post for ease of reading?

What properties make a magic weapon befit a Rogue more than a DEX-based Fighter?

Why would five hundred and five same as one?

Mortal danger in mid-grade literature

Do I have to take mana from my deck or hand when tapping this card?

Trouble reading roman numeral notation with flats

Does capillary rise violate hydrostatic paradox?

Is there any common country to visit for persons holding UK and Schengen visas?

Relations between homogeneous polynomials

Recursively move files within sub directories

Why can't I get pgrep output right to variable on bash script?

Make a Bowl of Alphabet Soup

Hashing password to increase entropy

Started in 1987 vs. Starting in 1987

What is the period/term used describe Giuseppe Arcimboldo's style of painting?

Should a narrator ever describe things based on a character's view instead of facts?



SeleniumGrid - file upload fails while running remotely


Create and upload a file on selenium gridHow to avoid Java code in JSP files?Selenium 'ant run-demo-in-parallel' command failure?TimeOut issue and stale instances of webdriver after test failsRunning WebdriverJS test on Selenium GridSelenium tests fail on remote machine for chrome and ie driversSelenium grid execution - How to upload multiple files together(at one time) to webpage using sendkeysDoes the Selenium Chrome remote webdriver with mobile emulation support touch gestures?Has anyone used the Java robot class to execute keystrokes using remoteWebDriver on Selenium grid?Chrome driver is not able to pickup a file from the system when we run it through a ServiceHow to run testcafe from docker on remote selenium grid













0















The following command executes correctly when running on local:



String fileLocation = "/Users/local/file.xlsx";
chro.findElement(By.xpath("//input[@title='input']")).sendKeys(fileLocation);


But fails when running remotely (on selenium grid) with following exception: org.openqa.selenium.InvalidArgumentException: invalid argument: File not found : /Users/local/file.xlsx

Does anyone know what might be the reason?










share|improve this question

















  • 1





    /Users/local/file.xlsx doesn't exist on the remote node... it's a local path.

    – Corey Goldberg
    Mar 7 at 1:21











  • Is there a way to wrap the file and pass it onto this specific node?

    – Yulaz
    Mar 7 at 1:24















0















The following command executes correctly when running on local:



String fileLocation = "/Users/local/file.xlsx";
chro.findElement(By.xpath("//input[@title='input']")).sendKeys(fileLocation);


But fails when running remotely (on selenium grid) with following exception: org.openqa.selenium.InvalidArgumentException: invalid argument: File not found : /Users/local/file.xlsx

Does anyone know what might be the reason?










share|improve this question

















  • 1





    /Users/local/file.xlsx doesn't exist on the remote node... it's a local path.

    – Corey Goldberg
    Mar 7 at 1:21











  • Is there a way to wrap the file and pass it onto this specific node?

    – Yulaz
    Mar 7 at 1:24













0












0








0








The following command executes correctly when running on local:



String fileLocation = "/Users/local/file.xlsx";
chro.findElement(By.xpath("//input[@title='input']")).sendKeys(fileLocation);


But fails when running remotely (on selenium grid) with following exception: org.openqa.selenium.InvalidArgumentException: invalid argument: File not found : /Users/local/file.xlsx

Does anyone know what might be the reason?










share|improve this question














The following command executes correctly when running on local:



String fileLocation = "/Users/local/file.xlsx";
chro.findElement(By.xpath("//input[@title='input']")).sendKeys(fileLocation);


But fails when running remotely (on selenium grid) with following exception: org.openqa.selenium.InvalidArgumentException: invalid argument: File not found : /Users/local/file.xlsx

Does anyone know what might be the reason?







java selenium-webdriver selenium-chromedriver selenium-grid






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 7 at 1:08









YulazYulaz

214




214







  • 1





    /Users/local/file.xlsx doesn't exist on the remote node... it's a local path.

    – Corey Goldberg
    Mar 7 at 1:21











  • Is there a way to wrap the file and pass it onto this specific node?

    – Yulaz
    Mar 7 at 1:24












  • 1





    /Users/local/file.xlsx doesn't exist on the remote node... it's a local path.

    – Corey Goldberg
    Mar 7 at 1:21











  • Is there a way to wrap the file and pass it onto this specific node?

    – Yulaz
    Mar 7 at 1:24







1




1





/Users/local/file.xlsx doesn't exist on the remote node... it's a local path.

– Corey Goldberg
Mar 7 at 1:21





/Users/local/file.xlsx doesn't exist on the remote node... it's a local path.

– Corey Goldberg
Mar 7 at 1:21













Is there a way to wrap the file and pass it onto this specific node?

– Yulaz
Mar 7 at 1:24





Is there a way to wrap the file and pass it onto this specific node?

– Yulaz
Mar 7 at 1:24












2 Answers
2






active

oldest

votes


















0














According to the error you are getting, it seems that the path /Users/local/file.xlsx is not present on the server you are executing the script on.



To fix the issue, you can make a folder named exceldata inside your automation project and inside that folder you can insert your test data excel sheet file.xlsx and then you can set the path using System.getProperty("user.dir") (which gives the project directory path on the current system) and then you can set the xlsx path by using:



String fileLocation = System.getProperty("user.dir") + "/exceldata/file.xlsx";


Now, the above fileLocation is not dependent of the machine you are running the script on and can be used anywhere independently.






share|improve this answer























  • I should've been more descriptive... My project structure precisely follows your suggestion. I have a dedicated folder containing test files within workspace and use system property to derive it's location. What I was referring to above is a case where my local box was running a set against remote: local -> grid.

    – Yulaz
    Mar 8 at 1:12











  • Just found the answer - stackoverflow.com/a/16244627/9336888 TLDR: use FileDetector to send your file over the wire. driver = new RemoteWebDriver(new URL(hubUrl), options); ((RemoteWebDriver) driver).setFileDetector(new LocalFileDetector());

    – Yulaz
    Mar 8 at 1:23



















0














Found the answer - stackoverflow.com/a/16244627/9336888



TLDR: use FileDetector to send your file over the wire.



driver = new RemoteWebDriver(new URL(hubUrl), options); 
((RemoteWebDriver) driver).setFileDetector(new LocalFileDetector());





share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55034567%2fseleniumgrid-file-upload-fails-while-running-remotely%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    According to the error you are getting, it seems that the path /Users/local/file.xlsx is not present on the server you are executing the script on.



    To fix the issue, you can make a folder named exceldata inside your automation project and inside that folder you can insert your test data excel sheet file.xlsx and then you can set the path using System.getProperty("user.dir") (which gives the project directory path on the current system) and then you can set the xlsx path by using:



    String fileLocation = System.getProperty("user.dir") + "/exceldata/file.xlsx";


    Now, the above fileLocation is not dependent of the machine you are running the script on and can be used anywhere independently.






    share|improve this answer























    • I should've been more descriptive... My project structure precisely follows your suggestion. I have a dedicated folder containing test files within workspace and use system property to derive it's location. What I was referring to above is a case where my local box was running a set against remote: local -> grid.

      – Yulaz
      Mar 8 at 1:12











    • Just found the answer - stackoverflow.com/a/16244627/9336888 TLDR: use FileDetector to send your file over the wire. driver = new RemoteWebDriver(new URL(hubUrl), options); ((RemoteWebDriver) driver).setFileDetector(new LocalFileDetector());

      – Yulaz
      Mar 8 at 1:23
















    0














    According to the error you are getting, it seems that the path /Users/local/file.xlsx is not present on the server you are executing the script on.



    To fix the issue, you can make a folder named exceldata inside your automation project and inside that folder you can insert your test data excel sheet file.xlsx and then you can set the path using System.getProperty("user.dir") (which gives the project directory path on the current system) and then you can set the xlsx path by using:



    String fileLocation = System.getProperty("user.dir") + "/exceldata/file.xlsx";


    Now, the above fileLocation is not dependent of the machine you are running the script on and can be used anywhere independently.






    share|improve this answer























    • I should've been more descriptive... My project structure precisely follows your suggestion. I have a dedicated folder containing test files within workspace and use system property to derive it's location. What I was referring to above is a case where my local box was running a set against remote: local -> grid.

      – Yulaz
      Mar 8 at 1:12











    • Just found the answer - stackoverflow.com/a/16244627/9336888 TLDR: use FileDetector to send your file over the wire. driver = new RemoteWebDriver(new URL(hubUrl), options); ((RemoteWebDriver) driver).setFileDetector(new LocalFileDetector());

      – Yulaz
      Mar 8 at 1:23














    0












    0








    0







    According to the error you are getting, it seems that the path /Users/local/file.xlsx is not present on the server you are executing the script on.



    To fix the issue, you can make a folder named exceldata inside your automation project and inside that folder you can insert your test data excel sheet file.xlsx and then you can set the path using System.getProperty("user.dir") (which gives the project directory path on the current system) and then you can set the xlsx path by using:



    String fileLocation = System.getProperty("user.dir") + "/exceldata/file.xlsx";


    Now, the above fileLocation is not dependent of the machine you are running the script on and can be used anywhere independently.






    share|improve this answer













    According to the error you are getting, it seems that the path /Users/local/file.xlsx is not present on the server you are executing the script on.



    To fix the issue, you can make a folder named exceldata inside your automation project and inside that folder you can insert your test data excel sheet file.xlsx and then you can set the path using System.getProperty("user.dir") (which gives the project directory path on the current system) and then you can set the xlsx path by using:



    String fileLocation = System.getProperty("user.dir") + "/exceldata/file.xlsx";


    Now, the above fileLocation is not dependent of the machine you are running the script on and can be used anywhere independently.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Mar 7 at 5:47









    Sameer AroraSameer Arora

    1,663315




    1,663315












    • I should've been more descriptive... My project structure precisely follows your suggestion. I have a dedicated folder containing test files within workspace and use system property to derive it's location. What I was referring to above is a case where my local box was running a set against remote: local -> grid.

      – Yulaz
      Mar 8 at 1:12











    • Just found the answer - stackoverflow.com/a/16244627/9336888 TLDR: use FileDetector to send your file over the wire. driver = new RemoteWebDriver(new URL(hubUrl), options); ((RemoteWebDriver) driver).setFileDetector(new LocalFileDetector());

      – Yulaz
      Mar 8 at 1:23


















    • I should've been more descriptive... My project structure precisely follows your suggestion. I have a dedicated folder containing test files within workspace and use system property to derive it's location. What I was referring to above is a case where my local box was running a set against remote: local -> grid.

      – Yulaz
      Mar 8 at 1:12











    • Just found the answer - stackoverflow.com/a/16244627/9336888 TLDR: use FileDetector to send your file over the wire. driver = new RemoteWebDriver(new URL(hubUrl), options); ((RemoteWebDriver) driver).setFileDetector(new LocalFileDetector());

      – Yulaz
      Mar 8 at 1:23

















    I should've been more descriptive... My project structure precisely follows your suggestion. I have a dedicated folder containing test files within workspace and use system property to derive it's location. What I was referring to above is a case where my local box was running a set against remote: local -> grid.

    – Yulaz
    Mar 8 at 1:12





    I should've been more descriptive... My project structure precisely follows your suggestion. I have a dedicated folder containing test files within workspace and use system property to derive it's location. What I was referring to above is a case where my local box was running a set against remote: local -> grid.

    – Yulaz
    Mar 8 at 1:12













    Just found the answer - stackoverflow.com/a/16244627/9336888 TLDR: use FileDetector to send your file over the wire. driver = new RemoteWebDriver(new URL(hubUrl), options); ((RemoteWebDriver) driver).setFileDetector(new LocalFileDetector());

    – Yulaz
    Mar 8 at 1:23






    Just found the answer - stackoverflow.com/a/16244627/9336888 TLDR: use FileDetector to send your file over the wire. driver = new RemoteWebDriver(new URL(hubUrl), options); ((RemoteWebDriver) driver).setFileDetector(new LocalFileDetector());

    – Yulaz
    Mar 8 at 1:23














    0














    Found the answer - stackoverflow.com/a/16244627/9336888



    TLDR: use FileDetector to send your file over the wire.



    driver = new RemoteWebDriver(new URL(hubUrl), options); 
    ((RemoteWebDriver) driver).setFileDetector(new LocalFileDetector());





    share|improve this answer



























      0














      Found the answer - stackoverflow.com/a/16244627/9336888



      TLDR: use FileDetector to send your file over the wire.



      driver = new RemoteWebDriver(new URL(hubUrl), options); 
      ((RemoteWebDriver) driver).setFileDetector(new LocalFileDetector());





      share|improve this answer

























        0












        0








        0







        Found the answer - stackoverflow.com/a/16244627/9336888



        TLDR: use FileDetector to send your file over the wire.



        driver = new RemoteWebDriver(new URL(hubUrl), options); 
        ((RemoteWebDriver) driver).setFileDetector(new LocalFileDetector());





        share|improve this answer













        Found the answer - stackoverflow.com/a/16244627/9336888



        TLDR: use FileDetector to send your file over the wire.



        driver = new RemoteWebDriver(new URL(hubUrl), options); 
        ((RemoteWebDriver) driver).setFileDetector(new LocalFileDetector());






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 8 at 1:29









        YulazYulaz

        214




        214



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55034567%2fseleniumgrid-file-upload-fails-while-running-remotely%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

            Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

            Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved