Save image in firefox: problem?

377 views
Skip to first unread message

Bruno Pio

unread,
Apr 11, 2012, 9:13:40 PM4/11/12
to Watir General
Hi!

How can I save an image in firefox?

I put:
require 'watir-webdriver'
ff = Watir::Browser.new
ff.goto "https://www.libertyreserve.com/en/account"
ff.browser.image(:id, "captcha").save("c:\\captcha.jpg")

And I got:
NotImplementedError: not currently supported by WebDriver
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.5.4/
lib/watir
-webdriver/elements/image.rb:48:in `save'
from (irb):4
from C:/Ruby193/bin/irb:12:in `<main>'

How can I solve this problem? Any help?

Chuck van der Linden

unread,
Apr 11, 2012, 11:03:19 PM4/11/12
to watir-...@googlegroups.com
Use a different  browser.
 
Or better yet configure your test env to disable the captcha or replace it with a stub.  Most capchas are somebody elses code so there is little value in spending your time testing them.

Anthony Hallett

unread,
Apr 12, 2012, 12:13:07 AM4/12/12
to watir-...@googlegroups.com
Lol  ..  Using a different browser will not help; image.save always throws a NotImplementedError  .. 

Željko Filipin

unread,
Apr 12, 2012, 4:38:26 AM4/12/12
to watir-...@googlegroups.com
On Thu, Apr 12, 2012 at 3:13 AM, Bruno Pio <brun...@gmail.com> wrote:
> NotImplementedError: not currently supported by WebDriver

Well, as the error message says, it is not currently supported:


You should be able to get "src" attribute of the image and save it with another tool (like wget, or ruby's net/http library).

The question is, what are you trying to do?

Željko
--
watir.com/book - author

Bruno Pio

unread,
Apr 12, 2012, 6:52:35 AM4/12/12
to watir-...@googlegroups.com

If I try to use another tool, captcha will be reload... I need to use the same tool to not reload the captcha. In my case, I use watir for automation, not for test webserver. I need to download the captcha to send to another server that will solve it for me, because if I send the link of the captcha, captcha will be reload. Is there a way to use net/http library inside watir?

> --
> Before posting, please read http://watir.com/support. In short: search before you ask, be nice.
>  
> watir-...@googlegroups.com
> http://groups.google.com/group/watir-general
> watir-genera...@googlegroups.com

Željko Filipin

unread,
Apr 12, 2012, 7:00:17 AM4/12/12
to watir-...@googlegroups.com
On Thu, Apr 12, 2012 at 12:52 PM, Bruno Pio <brun...@gmail.com> wrote:
> I need to download the captcha to send to another server that will solve it for me

Are you automating the site your team is developing? You should let them know that the point of captcha is to prove that you are human. If you have found a computer that can solve the captcha, than that is a bad captcha.

> Is there a way to use net/http library inside watir?

Both net/http and watir are Ruby libraries, and yes, you can get an URL with Watir and then download the file with net/http.

Željko

Bruno Pio

unread,
Apr 12, 2012, 12:33:18 PM4/12/12
to watir-...@googlegroups.com
Sorry to disappoint you, but today the captcha (all of them) only serves to delay the bots, not avoid them. I am here to test if watir can be used to escape the captcha using an intermediate server, like other tools can. As I said, if I can get the captcha and send it to a person or a server, such as captchatrader.com, in which people solve captchas for a low price ($1 per 1000 correct CAPTCHAs), I can escape the captcha. This is my automation test: A bot be a person as close as possible. But at the moment I see that watir can not make a "bot" to do this directly. At least until it is implemented the "save".

;-)

Chuck van der Linden

unread,
Apr 12, 2012, 12:57:38 PM4/12/12
to watir-...@googlegroups.com
Many of us are well aware that there are ways around captchas.   That's not the point, nor are you disappointing me with that 'news'  (although that you would spend time trying to work around a captcha is dissapointing, because it means you are either wasting your time, or working towards nefarious ends)

Watir is designed as a test tool.  For people doing legitimate testing, there is no need to meatbot your way around a captcha.  You do limited manual testing as needed in your live environment to validate the captcha is configured correctly and working.  In your test environment it is coded around, turned off, or hits a special stub that uses a predictable response (or embeds the expected value in the HTML).  Just as you would turn off any online advertising, website metrics, tracking pixels, and other code that is typically 3rd party and has no value (or negative value) running in a test environment.  That's generally easier, cheaper, and does not serve to support a service that exists only to facilitate spamming.

So what purpose is there to determining if watir can be used to source a captcha to a meatbot?  I don't see this as a criteria for a legitimate tester, but rather for someone who is trying to use watir as a tool to bypass captcha's and post spam to websites that don't want it posted there.  and if that is your purpose, you will find zero support for it here, go abuse someone elses tool (which given that the message is coming from the webdriver side, will not likely be based on webdriver)  Otherwise I'm here to tell you that's a poor criteria for selecting a test tool since there are better ways for testers to get around captcha's running in a test environment.

Bruno Pio

unread,
Apr 12, 2012, 1:16:16 PM4/12/12
to watir-...@googlegroups.com
Sorry, but I am only searching for tools that can have a possibility to make a bot that can fake a human.
I understand your point.
I only show here a problem.
If the problem is ethical or not, it does not will stop being a problem, at least for me.
Sorry again if my english is not sufficient clear to tell what I want to tell.
I will unsubscribe this group.
Reply all
Reply to author
Forward
0 new messages