1

I want to write a script that fills out a form and uploads a file in cucumber-js,selenium,and protractor. whenever I click an upload file button though, there is no xpath/id/etc... to click on. How do you handle file uploads?

1

1 Answer 1

1

By the way uploading file has nothing to do with cucumberjs. Just send keys to input with type=file. Also make sure that file path is absolute. So a pure WebDriver code could be look like,

driver.findElement(wd.By.css('input[type=file]')).sendKeys('/absolute/path/to/my/file');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.