how to upload file other than autoit
Answers were Sorted based on User's Feedback
Answer / ndp
You can use both AutoIT or Robot class for upload functionality.
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / bharat
You can use ROBOT API jars to upload the file. Simply trigger the browse button and when you need to give the location of your file to upload use Robot API to send the location and then again using Robot API press enter.
try {
//Setting clipboard with file location
setClipboardData(fileLocation);
//native key strokes for CTRL, V and ENTER keys
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
} catch (Exception exp) {
exp.printStackTrace();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / siddu
I was working on selenium scripts and came across file upload functionality. Selenium core JavaScript engine don't have capability to handle the windows pop-up due to same origin policy, so we need to relay on other tools. One of the best open source tool for handling windows objects is Autoit.
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / julie
By specifying the absolute path of the file using double backward slace(//) as an argument of sendkeys.
| Is This Answer Correct ? | 2 Yes | 2 No |
What do you know about Selenium IDE?
What are some advantages of selenium grid?
Write a code to wait for a particular element to be visible on a page. Write a code to wait for an alert to appear.
What are the ways to refresh a browser using selenium webdriver?
How to locate a link using its text in selenium?
How to find whether an element is displayed on the web page?
How to launch a browser using selenium webdriver?
How does one store the current url using selenium 2.0?
What are the different types of annotations which are used in selenium?
How can we deal with web-based pop-up?
How would one access the value of a side variable named name from within a javascript snippet used as the argument to a selenese command?
Firefox driver is class or an interface and from where is it inherited?