Thanks Paul..Whatever you said perfectly right! The suggestion you gave me definately going to work for my problem let me try.
 Thanks & Regards,
 Prakash

On 3/31/06, Paul Carvalho <[EMAIL PROTECTED]> wrote:
Hello Prakash, unless I'm mistaken (and it's quite possible), it sounds like your session cookie is persistent between script runs.  So even when you close the browser, it remembers that you were logged in so the next time you go to the site it logs you in automatically.  Does that sound right?

I'm not sure how to kill the session cookie for your app because every app is different.  One thing I might suggest would be to include a bypass in your login script to see if the username field exists on the page.  If the field exists, then proceed with login.  If it doesn't, then just continue on with the home page.

For example, something like:

ie.goto( URL )
if ie.text_field(:name, /username/).exists?
    # enter username
    # enter password
    # click sign in button (or whatever)
end
...

Or something like that.  There could be a dozen variations on a check like this.

I did something similar with one of my login scripts too because sometimes a user will be prompted to change their password upon login, and sometimes they won't.  I had to include the check so that the script didn't always assume that it had to enter that information.

Hope this helps.  Paul.



On 31/03/06, Prakash Sattu <[EMAIL PROTECTED]> wrote:
I will go to my application through another application by supplying username and password, After successfully  login, I will get access to my application. Once I am in the application there is no way to logout from  my application unless I close the browser. The problem with testing Watir  is, first time when I run the test case, it will run fine but if I run second time by default it logs in automatically but in the test it expects to login that is where it get fails.Even though, I close the browser by end of each test still when I run the test it logs in automatically. How to kill the session so that if I run the test next time, it should suppose to ask for username and password. Any help would be  a great help.
 
Regards
Prakash
 


_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general


_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to