java - Selenium RC not able to work with downloads popup window -
i new selenium rc. have been working in eclipse run simple junit test case run , download flashplayer adobe.com.
but selenium rc not able click or recognise downloads pop window. have been seeing several suggestions in google search still not able it.
i have been trying window id or name of pop window work it, still not able it. have copied major function of code here down below:
public void testpopup() throws exception { selenium.open("http://get.adobe.com/"); selenium.open("/flashplayer/"); selenium.click("id=buttondownload"); string ids[]=selenium.getallwindowids(); for(int i=0;i<ids.length;i++) system.out.println(ids[i]); string[] windownames=selenium.getallwindownames(); for(int i=0;i<windownames.length;i++) system.out.println(windownames[i]); string feedwinid = selenium.geteval("{var windowid; for(var x in selenium.browserbot.openedwindows ) {windowid=x;} }"); system.out.println(feedwinid); selenium.chooseokonnextconfirmation(); selenium.waitforpagetoload("30000"); }
it great if can me out this.
thanks
the short answer: can't.
the longer, still disappointing answer:
you can't, because no current selenium implementation supports it. selenium people know it, it's nr. 13 in wanted features in selenium right now
selenium rc never have because of technical limitations (it's pure javascript. , pure javascript can't download , save files.) , has been deprecated on year ago. selenium webdriver ... well, maybe, in future. various things can try instead:
- rethink whether need download file. isn't ok assert file exists , can downloaded making http request , seeing answer
200 ok
? - can't download file using pure java after it's url via selenium? think best way go.
- if you're using webdriver, there a great tool downloading files!
- if you're using firefox, can set clean testing profile configured download every clicked file specified folder. there addons out there can it, too. i'm not sure whether selenium rc supports usign precreated profile, selenium webdriver does.
- if you're using 1 given browser tests, can figure out how download file "blindly" pressing buttons blindly.
robot
class can help that. click file , blindly press enter or whatever keys download file right place. there autoit framework lot people use task.
Comments
Post a Comment