robotframework / OldSeleniumLibrary

Deprecated Selenium library for Robot Framework
Apache License 2.0
13 stars 3 forks source link

Add "Download File" Keyword #129

Closed spooning closed 9 years ago

spooning commented 9 years ago

Originally submitted to Google Code by Andreas.EbbertKarroum on 13 Jul 2010

Add a "Download File" keyword to the library. Description in the codecentric blog:

http://blog.codecentric.de/en/2010/07/file-downloads-with-selenium-mission-impossible

spooning commented 9 years ago

Originally submitted to Google Code by spielman... on 19 Sep 2010

Pekka stated in the comments of above blog post:

"Very nice!

Instead of using wget you could have implemented a simple keyword with Python using urllib and/or urllib2 modules. This would remove the dependency to wget and thus make the approach platform independent. Should we actually add Download file keyword to SeleniumLibrary itself?"

@⁠Andreas: I propose that we look at implementing this with urllib(2).

My 2 cents:

I do think that the idea is interesting and that the need for such a keyword arises on a regular basis. Any ideas where this might go, if it were to be incorporated somewhere in RF or the associated libs?

spooning commented 9 years ago

Originally submitted to Google Code by @pekkaklarck on 20 Sep 2010

This functionality could be in a separate HTTP library. Implementing one using Python's httplib and urllib modules wouldn't be too hard technically. The biggest task would probably be deciding what keywords to include, how they should be used, and documenting everything thoroughly. In this case the SeleniumLibrary should get a keyword for getting cookie value (unless it already has).

I don't think adding this keyword into SeleniumLibrary would harm either, though.

spooning commented 9 years ago

Originally submitted to Google Code by Jameson.... on 2 Mar 2011

Here's a vote for just sticking it into SeleniumLibrary. I understand that that's not conceptually cleanest, but functionality matters more than that. It's something people would use, almost always from a context where SeleniumLibrary is already alive, so just use it there.

(And even if the goal is to find the "right, clean place" to put this function, I think that hacking it into selenium library and then waiting for someone to object is a better first step than dithering about it here. Forgiveness, not permission.)

spooning commented 9 years ago

Originally submitted to Google Code by mangaroo on 27 Sep 2011

I noticed a post in the referenced blog mentioning that "certain?" cookies were not accessible to Selenium, hence user had to use Selenium RC driver's capturenetworktraffic option enabled to sniff out the session cookie to use to then get the file. If we do plan to implement this issue, then need to look into this cookie thing first.

Also, use of httplib or urllib is best over wget for a solution that will work over Selenium Grid. Most Selenium workarounds like the GUI-based ones don't take into account Selenium Grid support (or they can't architecturally at present).

spooning commented 9 years ago

Originally submitted to Google Code by @pekkaklarck on 4 May 2012

Selenium RC has been deprecated and developing this library is thus ending. Selenium 2 (a.k.a. WebDriver) and Selenium2Library are the way forward. If you feel this issue is important, consider submitting it to the issue tracer of Selenenium2Library project.