how to upload file other than autoit

Answers were Sorted based on User's Feedback



how to upload file other than autoit..

Answer / ndp

You can use both AutoIT or Robot class for upload functionality.

Is This Answer Correct ?    3 Yes 2 No

how to upload file other than autoit..

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

how to upload file other than autoit..

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

how to upload file other than autoit..

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

Post New Answer

More Selenium Interview Questions

How can we handle pop-ups in rc?

0 Answers  


Which are the browsers supported by selenium rc?

0 Answers  


Write a code snippet to navigate back and forward in browser history?

0 Answers  


what is the difference between absolute path and relative path?

0 Answers  


What is the selenium ide and what is it used for?

0 Answers  






How can you find if an element displayed on the screen?

0 Answers  


In which format does source view show the script in selenium ide?

0 Answers  


what are the Dynamic elements in web Application?

2 Answers   Eton, HCL,


How can we create a data-driven framework using testng?

0 Answers  


How to take screenshots in selenium webdriver?

0 Answers  


What are the different types of locators in Selenium?

0 Answers   MCN Solutions,


Tell me how do perform drag and drop using selenium webdriver?

0 Answers  


Categories