Selenium IDE-geting cookies

523 views
Skip to first unread message

tal

unread,
Jul 21, 2010, 3:12:20 AM7/21/10
to Selenium Users
hi,

im trying to perform a test where in the end of the test i chetch the
cookies on the browser.

this is the test:

selenium.open("Open a site");
selenium.click("link=click On link");//when clicking on this link a
cookie is set on the browser
selenium.getCookieByName("cookie name");//find the cookie by her name
for (int second = 0;; second++) {
if (second >= 60) fail("timeout");
try { if ("ilou_10_0".equals(selenium.getCookie())) break; }
catch (Exception e) {}
Thread.sleep(1000);

the test never get the cookie( iv used all the cookei methods in the
IDE) althogh the cookie does exist in the browser.

DEEPAK BHATIA

unread,
Jul 21, 2010, 4:15:39 AM7/21/10
to seleniu...@googlegroups.com
There are some other people facing the issue.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


talk...@gmail.com

unread,
Jul 21, 2010, 5:13:03 AM7/21/10
to seleniu...@googlegroups.com
im the same one you talked to befor. you told me to write this post to selenium IDE users . thats what i did :)

DEEPAK BHATIA

unread,
Jul 21, 2010, 1:08:54 PM7/21/10
to seleniu...@googlegroups.com
All the best, actually I am not using cookies in my web application. But I have used IDE and RC. Sorry I am not able to help :-)

talk...@gmail.com

unread,
Jul 21, 2010, 3:29:04 PM7/21/10
to seleniu...@googlegroups.com
thats ok :) thenk you very much!!!

Marcus Döring

unread,
Jul 23, 2010, 2:51:35 AM7/23/10
to Selenium Users
so, does

try { if ("ilou_10_0".equals(selenium.getCookie())) break; }
catch (Exception e) {}

throw an exception? or does is

"ilou_10_0".equals(selenium.getCookie())

just evaluated as false?
I only work with selenium RC, but there the call .getCookie return a
string in a format like:
"JSESSIONID=76g9797gzv7vi".

So I think that this could be the source of your problem. good luck :)

On 21 Jul., 21:29, "tal.kf...@gmail.com" <talkf...@gmail.com> wrote:
> thats ok :) thenk you very much!!!
>
> On Wed, Jul 21, 2010 at 8:08 PM, DEEPAK BHATIA <toreachdee...@gmail.com>wrote:
>
> > All the best, actually I am not using cookies in my web application. But I
> > have used IDE and RC. Sorry I am not able to help :-)
>
> >   On Wed, Jul 21, 2010 at 2:43 PM, tal.kf...@gmail.com <talkf...@gmail.com
> > > wrote:
>
> >>   im the same one you talked to befor. you told me to write this post to
> >> selenium IDE users . thats what i did :)
>
> >>   On Wed, Jul 21, 2010 at 11:15 AM, DEEPAK BHATIA <
> >> toreachdee...@gmail.com> wrote:
>
> >>>  There are some other people facing the issue.
>
> >>> On Wed, Jul 21, 2010 at 12:42 PM, tal <talkf...@gmail.com> wrote:
>
> >>>> hi,
>
> >>>> im trying to perform a test where in the end of the test i chetch the
> >>>> cookies on the browser.
>
> >>>> this is the test:
>
> >>>> selenium.open("Open a site");
> >>>> selenium.click("link=click On link");//when clicking on this link a
> >>>> cookie is set on the browser
> >>>> selenium.getCookieByName("cookie name");//find the cookie by her name
> >>>> for (int second = 0;; second++) {
> >>>> if (second >= 60) fail("timeout");
> >>>> try { if ("ilou_10_0".equals(selenium.getCookie())) break; }
> >>>> catch (Exception e) {}
> >>>> Thread.sleep(1000);
>
> >>>> the test never get the cookie( iv used all the cookei methods in the
> >>>> IDE) althogh the cookie does exist in the browser.
>
> >>>> --
> >>>> You received this message because you are subscribed to the Google
> >>>> Groups "Selenium Users" group.
> >>>> To post to this group, send email to seleniu...@googlegroups.com.
> >>>> To unsubscribe from this group, send email to
> >>>> selenium-user...@googlegroups.com<selenium-users%2Bunsu...@googlegroups.com>
> >>>> .
> >>>> For more options, visit this group at
> >>>>http://groups.google.com/group/selenium-users?hl=en.
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups
> >>> "Selenium Users" group.
> >>> To post to this group, send email to seleniu...@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> selenium-user...@googlegroups.com<selenium-users%2Bunsu...@googlegroups.com>
> >>> .
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/selenium-users?hl=en.
>
> >> --
> >>   You received this message because you are subscribed to the Google
> >> Groups "Selenium Users" group.
> >> To post to this group, send email to seleniu...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> selenium-user...@googlegroups.com<selenium-users%2Bunsu...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/selenium-users?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Selenium Users" group.
> > To post to this group, send email to seleniu...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > selenium-user...@googlegroups.com<selenium-users%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages