Re: [wtr-general] Re: Basic Authentication using FireWatir on Ubuntu Linux
Thanks that was the commit. Will get that and add unit test cases and then merge it to master. On Tue, Apr 6, 2010 at 8:13 PM, Željko Filipin < zeljko.fili...@wa-research.ch> wrote: > On Tue, Apr 6, 2010 at 3:20 PM, Angrez Singh wrote: > > You got it correct, i couldn't find it on my local repository. Yes I did > push it to github. > > Is this the commit? > > > http://github.com/angrez/watir/commit/f4cb4c22a5c7cc2ee4fa1ba81d6e972cb7d34de0 > > You can grab that repository to your machine with this: > > git clone g...@github.com:angrez/watir.git > > Let me know if you need help with git. > > > Željko > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > You received this message because you are subscribed to > http://groups.google.com/group/watir-general > To post: watir-general@googlegroups.com > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe, reply using "remove me" as the subject.
Re: [wtr-general] Re: Basic Authentication using FireWatir on Ubuntu Linux
On Tue, Apr 6, 2010 at 3:20 PM, Angrez Singh wrote: > You got it correct, i couldn't find it on my local repository. Yes I did push it to github. Is this the commit? http://github.com/angrez/watir/commit/f4cb4c22a5c7cc2ee4fa1ba81d6e972cb7d34de0 You can grab that repository to your machine with this: git clone g...@github.com:angrez/watir.git Let me know if you need help with git. Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe, reply using "remove me" as the subject.
Re: [wtr-general] Re: Basic Authentication using FireWatir on Ubuntu Linux
You got it correct, i couldn't find it on my local repository. Yes I did push it to github. On Tue, Apr 6, 2010 at 4:55 PM, Željko Filipin < zeljko.fili...@wa-research.ch> wrote: > On Tue, Apr 6, 2010 at 1:19 PM, Angrez Singh wrote: > > I have added the basic authentication to Firewatir in my fork, but right > now not able to find the code in my local environment. > > I do not understand the problem. You remember you have worked on the code, > but you can not find it in your local git repository? Did you push it to > github? > > Željko > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > You received this message because you are subscribed to > http://groups.google.com/group/watir-general > To post: watir-general@googlegroups.com > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe, reply using "remove me" as the subject.
Re: [wtr-general] Re: Basic Authentication using FireWatir on Ubuntu Linux
On Tue, Apr 6, 2010 at 1:19 PM, Angrez Singh wrote: > I have added the basic authentication to Firewatir in my fork, but right now not able to find the code in my local environment. I do not understand the problem. You remember you have worked on the code, but you can not find it in your local git repository? Did you push it to github? Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe, reply using "remove me" as the subject.
Re: [wtr-general] Re: Basic Authentication using FireWatir on Ubuntu Linux
I have added the basic authentication to Firewatir in my fork, but right now not able to find the code in my local environment. Is there a way to get it back? On Tue, Apr 6, 2010 at 3:48 PM, Željko Filipin < zeljko.fili...@wa-research.ch> wrote: > On Sat, Apr 3, 2010 at 2:20 AM, lothar wrote: > > With help from Aedorn Varanis I've got things working on Firefox in > > Linux. > > Would you please add your solution to > http://wiki.openqa.org/display/WTR/Basic+Authentication wiki page? > > Please let me know if you need help with the wiki. > > > Željko > -- > watir.com - community manager > pledgie.com/campaigns/2982 - donate to Watir > watirpodcast.com - host > testingpodcast.com - audio podcasts on software testing. all of them > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > You received this message because you are subscribed to > http://groups.google.com/group/watir-general > To post: watir-general@googlegroups.com > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe, reply using "remove me" as the subject.
Re: [wtr-general] Re: Basic Authentication using FireWatir on Ubuntu Linux
On Sat, Apr 3, 2010 at 2:20 AM, lothar wrote: > With help from Aedorn Varanis I've got things working on Firefox in > Linux. Would you please add your solution to http://wiki.openqa.org/display/WTR/Basic+Authentication wiki page? Please let me know if you need help with the wiki. Željko -- watir.com - community manager pledgie.com/campaigns/2982 - donate to Watir watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe, reply using "remove me" as the subject.
[wtr-general] Re: Basic Authentication using FireWatir on Ubuntu Linux
With help from Aedorn Varanis I've got things working on Firefox in Linux. Aedorn sent me a "logon" method which issues a jssh command that checks for a "Authentication Required" dialog and if it exists, fills in the username/password and submits the dialog. I've copied and pasted what he sent me below: "You use a method that looks like this: def logon(username, password, wait=3) jssh_command = "var length = getWindows().length; var win;var found=false; for(var i = 0; i < length; i++) { win = getWindows()[i]; if(win.document.title == \"Authentication Required\") { found = true; break; }} if(found) { var jsdocument = win.document; var dialog = jsdocument.getElementsByTagName(\"dialog\")[0];" jssh_command << " jsdocument.getElementsByTagName(\"textbox\") [0].value = \"#{username}\";" jssh_command << " jsdocument.getElementsByTagName(\"textbox\") [1].value = \"#{password}\";" jssh_command << " dialog.getButton(\"accept\").click(); }\n" sleep(wait) $jssh_socket.send(jssh_command,0) read_socket() wait() end Then you can call it within its own thread just *before* going to the site with the login requirement: Thread.new { logon(user, pass) } @ff.goto("http://some_url.com";) sleep 3 Increase the wait and sleep time if the page takes awhile to load. If your main process tries to run while the command is being sent through the JSSH socket, it will stall and sit there forever until killed. Also, there's no real way to detect if the authentication window comes up. That means you need to make sure it always works the same way every time, or it, too, causes problems. Finally, the method will always have to be in another thread, because once the authentication window comes up, it stops all other processing until it goes away. Other than that, it works." >From this, I was able to subclass the FireWatir::Firefox class with a new Browser class which supports a "credentials=" method just like the Celerity::Browser does. So, just like using celerity, you can do: require 'browser' browser = Browser.new browser.credentials = 'user:pass' browser.goto('http://some.basic.auth.url') This will automatically fill in the Basic Auth dialog and log you into the site. I've posted the contents of my browser.rb file below (notice this works in ruby+firewatir and jruby+celerity in linux): ENGINE = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby' if ENGINE == 'ruby' require 'firewatir' class Browser < FireWatir::Firefox def initialize(options={}) super(options) @username = nil @password = nil end def credentials=(string) @username, @password = string.split(":") if @username.nil? or @password.nil? raise "Invalid credentials: #{string})" end end def goto(url, wait=3) if @username.nil? and @password.nil? return super(url) else t = Thread.new { logon(@username, @password, wait) } result = super(url) t.join return result end end private def logon(username, password, wait) jssh_command = " var length = getWindows().length; var win; var found = false; for (var i = 0; i < length; i++) { win = getWindows()[i]; if(win.document.title == \"Authentication Required\") { found = true; break; } } if (found) { var jsdocument = win.document; var dialog = jsdocument.getElementsByTagName(\"dialog\")[0]; jsdocument.getElementsByTagName(\"textbox\")[0].value = \"#{username}\"; jsdocument.getElementsByTagName(\"textbox\")[1].value = \"#{password}\"; dialog.getButton(\"accept\").click(); } \n" sleep(wait) $jssh_socket.send(jssh_command,0) read_socket() end end elsif ENGINE == 'jruby' require 'celerity' class Browser < Celerity::Browser; end else raise "Ruby ENGINE '#{ENGINE}' not supported." end Chris On Apr 1, 12:57 pm, Eric Mathiesen wrote: > I use XTE if I'm under x-windows in Linux Land. > if you are not familiar with the x test extensions you can read about it > here;http://www.google.com/url?sa=t&source=web&ct=res&cd=1&ved=0CAoQFjAA&u... > > ~Eric > > On Thu, Apr 1, 2010 at 12:54 PM, Ethan wrote: > > Is the solution that is in Angrez's fork written using AutoIt, or JSSH? If > > it is the latter, it should be compatible across all operating systems. But > > I haven't looked at it to see. > > AutoIt is windows-only, yes. > > > On Thu, Apr 1, 2010 at 13:54, lothar wrote: > > >> Thanks for the quick reply Željko. Yes, I checked out that site > >> before I posted to the group, but it seems to contain windows only > >> solutions. Solution 1 requires 'watir' and 'watir/WindowHelper' which > >> in turn require things like 'watir/win32ole' and 'watir/ie'. It > >> doesn't look like there is a firewatir equivalent to 'watir/ > >> WindowHelpe
[wtr-general] Re: Basic Authentication using FireWatir on Ubuntu Linux
there is something called WinClicker for firewatir also, which seems to be for linux only due to this statement: if /linux/i.match(RUBY_PLATFORM) So i guess that the "Win" part there means just a regular window :) Look into it's methods and maybe it helps. Jarmo On Apr 1, 10:57 pm, Eric Mathiesen wrote: > I use XTE if I'm under x-windows in Linux Land. > if you are not familiar with the x test extensions you can read about it > here;http://www.google.com/url?sa=t&source=web&ct=res&cd=1&ved=0CAoQFjAA&u... > > ~Eric > > > > On Thu, Apr 1, 2010 at 12:54 PM, Ethan wrote: > > Is the solution that is in Angrez's fork written using AutoIt, or JSSH? If > > it is the latter, it should be compatible across all operating systems. But > > I haven't looked at it to see. > > AutoIt is windows-only, yes. > > > On Thu, Apr 1, 2010 at 13:54, lothar wrote: > > >> Thanks for the quick reply Željko. Yes, I checked out that site > >> before I posted to the group, but it seems to contain windows only > >> solutions. Solution 1 requires 'watir' and 'watir/WindowHelper' which > >> in turn require things like 'watir/win32ole' and 'watir/ie'. It > >> doesn't look like there is a firewatir equivalent to 'watir/ > >> WindowHelper' (i.e. 'firewatir/WindowHelper'). Solution 2 is a > >> windows only solution as well (uses autoit, which I *think* is IE > >> only, but could be wrong on this). > > >> Unless I missed something, that page doesn't contain any solution that > >> works on firewatir + linux. > > >> Any other suggestions? > > >> On Apr 1, 4:07 am, Željko Filipin > >> wrote: > >> > On Wed, Mar 31, 2010 at 10:26 PM, lothar wrote: > >> > > I'm trying to use FireWatir (1.6.5) to access a site using Basic > >> > > Authentication and I've been unable to find a solution that works on > >> > > Firefox in Linux. > > >> > Did you read this? > > >> >http://wiki.openqa.org/display/WTR/Basic+Authentication > > >> > Željko > >> > -- > >> > watir.com - community manager > >> > pledgie.com/campaigns/2982 - donate to Watir > >> > watirpodcast.com - host > >> > testingpodcast.com - audio podcasts on software testing. all of them > > >> -- > >> Before posting, please readhttp://watir.com/support. In short: search > >> before you ask, be nice. > > >> You received this message because you are subscribed to > >>http://groups.google.com/group/watir-general > >> To post: watir-general@googlegroups.com > >> To unsubscribe: > >> watir-general+unsubscr...@googlegroups.com >> legroups.com> > > >> To unsubscribe, reply using "remove me" as the subject. > > > -- > > Before posting, please readhttp://watir.com/support. In short: search > > before you ask, be nice. > > > You received this message because you are subscribed to > >http://groups.google.com/group/watir-general > > To post: watir-general@googlegroups.com > > To unsubscribe: > > watir-general+unsubscr...@googlegroups.com > legroups.com> -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com
Re: [wtr-general] Re: Basic Authentication using FireWatir on Ubuntu Linux
I use XTE if I'm under x-windows in Linux Land. if you are not familiar with the x test extensions you can read about it here; http://www.google.com/url?sa=t&source=web&ct=res&cd=1&ved=0CAoQFjAA&url=http%3A%2F%2Fwww.x.org%2Freleases%2FX11R7.5%2Fdoc%2FXext%2Fxtestlib.pdf&ei=ivq0S4rPDYL58AbCsdWuAw&usg=AFQjCNGryri6kyJls5FuhirfKwvnn4KvJw&sig2=Ad-jWmA6Hz6ccZs2RZOMIA ~Eric On Thu, Apr 1, 2010 at 12:54 PM, Ethan wrote: > Is the solution that is in Angrez's fork written using AutoIt, or JSSH? If > it is the latter, it should be compatible across all operating systems. But > I haven't looked at it to see. > AutoIt is windows-only, yes. > > On Thu, Apr 1, 2010 at 13:54, lothar wrote: > >> Thanks for the quick reply Željko. Yes, I checked out that site >> before I posted to the group, but it seems to contain windows only >> solutions. Solution 1 requires 'watir' and 'watir/WindowHelper' which >> in turn require things like 'watir/win32ole' and 'watir/ie'. It >> doesn't look like there is a firewatir equivalent to 'watir/ >> WindowHelper' (i.e. 'firewatir/WindowHelper'). Solution 2 is a >> windows only solution as well (uses autoit, which I *think* is IE >> only, but could be wrong on this). >> >> Unless I missed something, that page doesn't contain any solution that >> works on firewatir + linux. >> >> Any other suggestions? >> >> On Apr 1, 4:07 am, Željko Filipin >> wrote: >> > On Wed, Mar 31, 2010 at 10:26 PM, lothar wrote: >> > > I'm trying to use FireWatir (1.6.5) to access a site using Basic >> > > Authentication and I've been unable to find a solution that works on >> > > Firefox in Linux. >> > >> > Did you read this? >> > >> > http://wiki.openqa.org/display/WTR/Basic+Authentication >> > >> > Željko >> > -- >> > watir.com - community manager >> > pledgie.com/campaigns/2982 - donate to Watir >> > watirpodcast.com - host >> > testingpodcast.com - audio podcasts on software testing. all of them >> >> -- >> Before posting, please read http://watir.com/support. In short: search >> before you ask, be nice. >> >> You received this message because you are subscribed to >> http://groups.google.com/group/watir-general >> To post: watir-general@googlegroups.com >> To unsubscribe: >> watir-general+unsubscr...@googlegroups.com >> >> To unsubscribe, reply using "remove me" as the subject. >> > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > You received this message because you are subscribed to > http://groups.google.com/group/watir-general > To post: watir-general@googlegroups.com > To unsubscribe: > watir-general+unsubscr...@googlegroups.com > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Basic Authentication using FireWatir on Ubuntu Linux
Is the solution that is in Angrez's fork written using AutoIt, or JSSH? If it is the latter, it should be compatible across all operating systems. But I haven't looked at it to see. AutoIt is windows-only, yes. On Thu, Apr 1, 2010 at 13:54, lothar wrote: > Thanks for the quick reply Željko. Yes, I checked out that site > before I posted to the group, but it seems to contain windows only > solutions. Solution 1 requires 'watir' and 'watir/WindowHelper' which > in turn require things like 'watir/win32ole' and 'watir/ie'. It > doesn't look like there is a firewatir equivalent to 'watir/ > WindowHelper' (i.e. 'firewatir/WindowHelper'). Solution 2 is a > windows only solution as well (uses autoit, which I *think* is IE > only, but could be wrong on this). > > Unless I missed something, that page doesn't contain any solution that > works on firewatir + linux. > > Any other suggestions? > > On Apr 1, 4:07 am, Željko Filipin > wrote: > > On Wed, Mar 31, 2010 at 10:26 PM, lothar wrote: > > > I'm trying to use FireWatir (1.6.5) to access a site using Basic > > > Authentication and I've been unable to find a solution that works on > > > Firefox in Linux. > > > > Did you read this? > > > > http://wiki.openqa.org/display/WTR/Basic+Authentication > > > > Željko > > -- > > watir.com - community manager > > pledgie.com/campaigns/2982 - donate to Watir > > watirpodcast.com - host > > testingpodcast.com - audio podcasts on software testing. all of them > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > You received this message because you are subscribed to > http://groups.google.com/group/watir-general > To post: watir-general@googlegroups.com > To unsubscribe: > watir-general+unsubscr...@googlegroups.com > > To unsubscribe, reply using "remove me" as the subject. > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Basic Authentication using FireWatir on Ubuntu Linux
Thanks for the quick reply Željko. Yes, I checked out that site before I posted to the group, but it seems to contain windows only solutions. Solution 1 requires 'watir' and 'watir/WindowHelper' which in turn require things like 'watir/win32ole' and 'watir/ie'. It doesn't look like there is a firewatir equivalent to 'watir/ WindowHelper' (i.e. 'firewatir/WindowHelper'). Solution 2 is a windows only solution as well (uses autoit, which I *think* is IE only, but could be wrong on this). Unless I missed something, that page doesn't contain any solution that works on firewatir + linux. Any other suggestions? On Apr 1, 4:07 am, Željko Filipin wrote: > On Wed, Mar 31, 2010 at 10:26 PM, lothar wrote: > > I'm trying to use FireWatir (1.6.5) to access a site using Basic > > Authentication and I've been unable to find a solution that works on > > Firefox in Linux. > > Did you read this? > > http://wiki.openqa.org/display/WTR/Basic+Authentication > > Željko > -- > watir.com - community manager > pledgie.com/campaigns/2982 - donate to Watir > watirpodcast.com - host > testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com To unsubscribe, reply using "remove me" as the subject.