0

I cannot figure out how to use the "Choose File" functionality

I have the following website in which i want to upload the file C://RobotAutomation/Customers/in/test.csv

The website looks as follows

enter image description here

The corresponding html is as follows:

enter image description here

My Test Script in RobotFramework is as follows:

Click Button   xpath=//button[@name='file']
Sleep 5
Choose File  xpath=//button[@name='file']  C://RobotAutomation/Customers/in/test.csv

The result is that the File Dialog box is opened, but it is not automatically populated with the test.csv file.

I am not sure if the correct locator is specified. This is because of the Angular code that is used.

What i am doing wrong here ?

Bence Kaulics
  • 7,066
  • 7
  • 33
  • 63
Arun
  • 1
  • 1
  • 1
    Please take the time to add the html as text to the question - not a picture link; format the code properly (use either 4 spaces before each line, or ``` for start & end of the code block); and preferably embed the image so it displays inline. In its current form, it's really hard to read - and not a lot of folks are going to type out the html just to reproduce. – Todor Minakov Feb 05 '19 at 13:14

2 Answers2

0

If that file name is the actual value you use in the script, it is not correct - Windows does support / as path separator, but you have 2 between "C:" and "RobotAutomation".
Try like this:

Choose File  xpath=//button[@name='file']  C:/RobotAutomation/Customers/in/test.csv
Todor Minakov
  • 19,097
  • 3
  • 55
  • 60
0

Try this way, works for me C:\\RobotAutomation\\Customers\\in\\test.csv

WerKop
  • 53
  • 1
  • 6