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
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
add a comment |
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
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
add a comment |
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
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
java selenium-webdriver selenium-chromedriver selenium-grid
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
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.
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
add a comment |
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());
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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());
add a comment |
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());
add a comment |
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());
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());
answered Mar 8 at 1:29
YulazYulaz
214
214
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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