I'm writing Test Cases using Robot Framework and Selenium for my Web application. I tried to Upload a file, but I can't its failing.
My Code is
*** Variables ***
${TVAURL} http://localhost:1500/
${Browser} Firefox
TC_01: Enter into the application
[Documentation] Enter into the application to upload a file
Open Browser ${TVAURL} ${Browser}
maximize browser window
Choose File ........
HTML File:
<!DOCTYPE html>
<html>
<head>
<title>Upload File</title>
</head>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload Image" name="submit">
</form>
</body>
</html>
I need to know how to use this Choose File
for this file upload test. I don't know how to do this. I need to upload a file automatically without any third party tools like Autoit, etc.,
I referred the following http://robotframework.org/Selenium2Library/Selenium2Library.html#Choose%20File
Moreover I referred the following questions too
- File Upload Option in Automation Testing Using Robot Framework
- https://github.com/robotframework/OldSeleniumLibrary/issues/108
But I can't get any solutions. Kindly assist me how to do this using Robot Framework, Selenium in Pycharm Studio.
Reply for Answer #1: @demouser123
Still I'm having issue, here with I have attached the Screen shot
It always opens the Desktop, and fails. Kindly assist me.
I trided the following code
*** Variables ***
${PO_AddShell} //*[@id="fileToUpload"]
click button ${PO_AddShell}
Choose File ${PO_AddShell} E://Project/Publish/SampleTest.1500/rose.jpg