File upload in Selenium,Java,Robot Class

      No Comments on File upload in Selenium,Java,Robot Class


File Upload is achieved using the Java API java.awt.Robot class where awt stands for Abstract window Toolkit.
1. Robot class in java mainly useful to generate native system input events for the purposes of test automations.
2. The primary usage of Robot class is to facilitate automated testing of Java platform implementations
Test Steps:
1. Open Chrome Browser.
2. Enter the URL https://www.zamzar.com/.
3. Click on the button -Add Files
4. Opens the window Dialog box
5. Enter the absolute path of the file : C:\SeleniumArtifacts\TestCaseData.xlsx
6. Click on Enter button in the keyboard.


Java Logic

Expected Result:
File is uploaded successfully

Keyboard Actions:
1. ctrl + v ->C:\SeleniumArtifacts\TestCaseData.xlsx
2. enter
Conclusion:
File Upload is achieved in Selenium Automation Tool using the Java API.

Leave a Reply

Your email address will not be published. Required fields are marked *