I am using Selenium RC and Java and I need to automate the file upload feature.I tried a lot, Clicking on Browse button is not executing and rather getting stuck. I tried in FireFox but to no avail.
Below is my code:I used different commands to load file ...like "type" & "AttachFile".pls can any one help me how to upload a file from "File Upload window".
RemoteControlConfiguration rcc =new RemoteControlConfiguration();
rcc.setPort(3333);
SeleniumServer ss = new SeleniumServer(rcc);
ss.start();
DefaultSelenium browser = new DefaultSelenium("localhost" , 3333 , "*firefox" ,"http://");
browser.start();
browser.open("http://sqa.stackexchange.com/questions/ask");
browser.windowMaximize();
browser.setSpeed("20000");
browser.click("id=nav-askquestion");
browser.click("id=wmd-image-button");
//Used type command
browser.type("id=upload-file-input", "C:\\Documents and Settings\\Home\\Desktop\\dropdown.jpg");
//Used AttachFile command
browser.attachFile("id=upload-file-input","C:\\Documents and Settings\\Home\\Desktop\\dropdown.jpg");
//Used Runtime command
Runtime.getRuntime().exec("C:\\Documents and Settings\\Home\\Desktop\\dropdown.jpg");![enter image description here][1]