Uploading Files


Uploading a file is not easy with selenium we need to rely on Robot class or Auto IT tools. Now will share how to upload file using Robot Class.

Robot class is used to (generate native system input events) take the control of mouse and keyboard. Once you get the control, you can do any type of operation related to mouse and keyboard through with java code.
There are different methods which robot class uses. Here in the below example we have used 'keyPress' and 'keyRelease' methods.
keyPress - takes keyCode as Parameter and Presses here a given key.
keyrelease - takes keyCode as Parameterand Releases a given key 


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.