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

What selenium components do you know?

0 Answers  


What do you know about selenium?

0 Answers  


How to run test case traced by employing ide in browsers?

0 Answers  


What is XPath? How does it work?

0 Answers  


What is object repository? How can we create an object repository in selenium?

0 Answers  






What are the testing kinds that can be supported by selenium?

0 Answers  


How to launch a browser using selenium webdriver?

0 Answers  


in real time , which framework is used ? is it datadriven or keyword or hybrid ?? please answer

2 Answers   Cap Gemini,


Which is the super interface of webdriver?

0 Answers  


Explain junit. What are annotations?

0 Answers  


How is driver.close()command different from driver.quit command?

0 Answers  


What are the benefits of automation testing?

0 Answers  


Categories