0
votes

I am trying to automate the upload of an image in a website in robot framework (in Eclipse). I am using the keyword Choose File with the locator of the image upload button and the complete file path. The button on the website where you choose an image file to upload is the Choose an Image button. But the error I am getting is element not interactable.

File path = /Users/name/Desktop/hello1.png chrome version=77.0.3865.120 MacOS = 10.14.6

I have tried the keywords Scroll Element Into View and Wait Until Element is Visible to try and troubleshoot.

Scroll Element Into View //label[text()='Choose an Image']
Capture Element Screenshot    //label[text()='Choose an Image'] 
element.png  
Wait Until Element Is Visible    //label[text()='Choose an Image']  
Click Element                //label[text()='Choose an Image']         
Choose File     //label[text()='Choose an Image']    ${path}
2

2 Answers

0
votes

Choose File requires that you give it the path to an input element. You can't give it the locator to a label.

0
votes

You can try this way!

Wait Until Element Is Enabled   xpath://label[text()='Choose an Image']
Choose File    xpath://label[text()='Choose an Image']    ${path}