Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-10-02 Thread newlearner
thanks Zeljko. It still logs in to mail application with "uname" and "pwd" hence cannot login to yahoo mail. On Tuesday, October 2, 2012 1:53:45 AM UTC-7, Željko Filipin wrote: > > On Tue, Oct 2, 2012 at 3:46 AM, Joe Fleck > > wrote: > > def login_by_uname(uname,pwd) > >

Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-10-02 Thread newlearner
It logs in to mail application with "uname" and "pwd" hence cannot login to yahoo mail. - thanks On Monday, October 1, 2012 8:49:23 PM UTC-7, Joe Fl wrote: > > Hi, > > If you uncomment 'uname' and 'pwd' make the equal to nothing. You > will need to change both .nil? to .empty? and it might wo

Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-10-02 Thread Željko Filipin
On Tue, Oct 2, 2012 at 3:46 AM, Joe Fleck wrote: > def login_by_uname(uname,pwd) > if uname.nil? and pwd.nil? > uname = "per...@yahoo.com" > pwd = "abcd1234" > end Try this inst

Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-10-01 Thread Joe Fleck
Hi, If you uncomment 'uname' and 'pwd' make the equal to nothing. You will need to change both .nil? to .empty? and it might work. require 'watir' require 'rubygems' $browser = Watir::IE.new class Login def loginbyuname(uname,pwd) if uname.empty? and pwd.empty?

Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-10-01 Thread newlearner
Got the following error for this script `': undefined local variable or method `uname' for main:Object (NameError) thanks. On Monday, October 1, 2012 6:46:24 PM UTC-7, Joe Fl wrote: > Hi, > > I guess if you wanted a default username and password when one isn't > provided you could do this.

Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-10-01 Thread Joe Fleck
Hi, I guess if you wanted a default username and password when one isn't provided you could do this. (I did not test this to see if it works.) require 'watir' require 'rubygems' $browser = Watir::IE.new class Login def login_by_uname(uname,pwd) if uname.nil? and

Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-10-01 Thread Oscar Rieken
to me this seems like a simple problem of not really understanding ruby and how classes and methods work I would suggest to pick up the pickaxe book http://pragprog.com/book/ruby3/programming-ruby-1-9 def some_method(username, password) user_name_element.set username user_password_element.set pa

Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-10-01 Thread newlearner
Sort of. Though I quite didn't understand why I need to supply values in both places, in the method and to the parameters. If I remove the following uname = "per...@yahoo.com" pwd = "abcd1234" I got following error: "undefined local variable or method 'uname' for main:object ***

Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-10-01 Thread Joe Fleck
Hi, So the solutions we provided was what you were looking for? Thank you, Joe On Mon, Oct 1, 2012 at 12:50 PM, newlearner wrote: > > Thank you. Though it worked only if I supply the values for the arguements > in the method as well. So to give an example, I am pasting the code with the > inco

Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-10-01 Thread newlearner
Thank you. Though it worked only if I supply the values for the arguements in the method as well. So to give an example, I am pasting the code with the incorrect credentials you provided. (I have used correct login credentials). I have also taken Zeljko suggestion to start method name with low

Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-10-01 Thread Željko Filipin
On Sun, Sep 30, 2012 at 11:44 PM, newlearner wrote: > def LoginByUname(uname,pwd) I think method names in Ruby have to start with lower case. Try this: def loginByUname(uname,pwd) Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir

Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-09-30 Thread Joe Fleck
Hi, I tested this but with incorrect credential but this works. Hope this helps. require 'watir' require 'rubygems' $browser = Watir::IE.new class Login def LoginByUname(uname,pwd) $browser.goto("http://mail.yahoo.com";) puts "Correct URL"

Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-09-30 Thread newlearner
Hi Joe, thanks for the reply. Yes it still failed and the error was Undefined local variable or method 'browser' for Login:Class (NameError) On Sunday, September 30, 2012 2:51:47 PM UTC-7, Joe Fl wrote: > Hi. > > I would drop the $browser and just call the method. Though the method my > fa

Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-09-30 Thread Joe Fleck
Hi. I would drop the $browser and just call the method. Though the method my fail because the self isn't initialized as the $browser. On Sep 30, 2012 5:44 PM, "newlearner" wrote: > > Here is the code and the the error I am getting: > > undefined method "LoginByUname" for # > > require 'watir'

Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-09-30 Thread newlearner
Here is the code and the the error I am getting: undefined method "LoginByUname" for # require 'watir' require 'rubygems' $browser = Watir::IE.new class Login $browser.goto("http://mail.yahoo.com";) puts "Correct URL" def LoginByUname(uname,pwd) self.text_field(:id, "username").set('uname

Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-09-28 Thread Eric Mathiesen
+2 On Sep 28, 2012 12:14 PM, "Željko Filipin" wrote: > > On Fri, Sep 28, 2012 at 10:12 PM, Joe Fleck wrote: > > Can you paste your code in here? > > +1 > > Željko > > -- > Before posting, please read http://watir.com/support. In short: search before you ask, be nice. > > watir-general@googlegroup

Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-09-28 Thread Željko Filipin
On Fri, Sep 28, 2012 at 10:12 PM, Joe Fleck wrote: > Can you paste your code in here? +1 Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubsc

Re: [wtr-general] undefined method "LoginByAccountno" for #

2012-09-28 Thread Joe Fleck
Hi, Can you paste your code in here? Thank you, Joe On Fri, Sep 28, 2012 at 3:49 PM, newlearner wrote: > Hi there, > I am getting this error when I ran the script in ruby. Any help is > appreciated. > > undefined method "LoginByAccountno" for # > > thanks. > > -- > Before posting, please read h

[wtr-general] undefined method "LoginByAccountno" for #

2012-09-28 Thread newlearner
Hi there, I am getting this error when I ran the script in ruby. Any help is appreciated. undefined method "LoginByAccountno" for # thanks. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.