Help With Login Test (Popups Not Working)

5 views
Skip to first unread message

Geoff

unread,
Jun 22, 2008, 8:56:55 PM6/22/08
to watij
Hello,

I would like to be able to use Watij to test our Accu-Chek platform,
however, I am not able to get the past the security pop-up.

The flow is as follows: main page, click on sign in link, enter
username / password, click on sign in button, then the security pop-
up. I have tried several methods all in vein. Can anyone tell me why
my code does not work? Better yet, give me a working example. I
would love to move past this issue and start doing some real testing
with watij.

Best regards,
Geoff

---


import junit.framework.TestCase;
import watij.runtime.ie.IE;
import static watij.finders.SymbolFactory.*;
import watij.dialogs.ConfirmDialog;

public class AccuChekTest extends TestCase {
public void testAccuChekTest() throws Exception {
final IE ie = new IE();
ie.start("http://www.accu-chek.com/us");
ie.link(text,"Sign In").click();

ie.textField(name,"email").set("geofft...@yahoo.com");
ie.textField(name,"password").set("watijtest");


new Thread(new Runnable() {
public void run() {
try {
ie.button(" Sign In").click();
} catch (Exception e) {
e.printStackTrace(); }
}

}).start();

ie.sendKeys("Microsoft Internet Explorer", " ");
}
}

Geoff

unread,
Jun 22, 2008, 9:06:03 PM6/22/08
to watij
Also, I have proved this code works locally minus the pop-up box and I
have spent well over an hour searching for the answer to this issue.

On Jun 22, 8:56 pm, Geoff <geoffte...@gmail.com> wrote:
> Hello,
>
> I would like to be able to use Watij to test our Accu-Chek platform,
> however, I am not able to get the past the security pop-up.
>
> The flow is as follows:  main page, click on sign in link, enter
> username / password, click on sign in button, then the security pop-
> up.  I have tried several methods all in vein.  Can anyone tell me why
> my code does not work?  Better yet, give me a working example.  I
> would love to move past this issue and start doing some real testing
> with watij.
>
> Best regards,
> Geoff
>
> ---
>
> import junit.framework.TestCase;
> import watij.runtime.ie.IE;
> import static watij.finders.SymbolFactory.*;
> import watij.dialogs.ConfirmDialog;
>
> public class AccuChekTest extends TestCase {
>     public void testAccuChekTest() throws Exception {
>         final IE ie = new IE();
>         ie.start("http://www.accu-chek.com/us");
>         ie.link(text,"Sign In").click();
>
>         ie.textField(name,"email").set("geofftest...@yahoo.com");

John Overbaugh

unread,
Jun 23, 2008, 2:19:50 AM6/23/08
to wa...@googlegroups.com
Geoff,

Ironically I saw something very similar with Selenium (and firefox this time). I searched and searched for an elegant solution, and finally gave up and implemented the 'hacky' solution of writing code to dismiss a dialog with a given name.

If you are a .NET programmer, you can implement the code I used - someone on the MSDN Software Testing Forum provided sample code to look for a window with a given title and dismiss it. Not sure if you can easily do this in Java; I doubt it, but you might be able to. Here is the article:

http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3380783&SiteID=1


NOTE: it was really helpful to put in a 1-second thread.sleep statement at the end of the search for the dialog. Saved a lot of CPU - one second is nearly an eternity on a CoreDuo box, you know?

John O.
http://thoughtsonqa.blogspot.com
--
John Overbaugh
blog: http://thoughtsonqa.blogspot.com

Chris Hall

unread,
Jun 23, 2008, 6:22:28 AM6/23/08
to wa...@googlegroups.com
Guys, I'm not positive, but I think that your browser.sendKeys actually gets directed to the parent browser window, and not the "Security Information" dialog.

I've tried different methods of accessing it, but to no avail. The Yes() method in IESecurityAlertDialog looks for windows with a title of "Windows Internet Explorer" - maybe this is the problem?

just my 2 cents...

Geoff

unread,
Jun 23, 2008, 9:12:24 AM6/23/08
to watij
John, thank you for your reply, I will try that method here in a
little bit.

Chris, I think the same thing, I cannot get the sendKey to go to the
"Security Information" pop-up. It's going to the main browser
instead. Any ideas? Seems like I might have to port John's code over
to Java to get this working. Not that it is a bad thing, but like
John, I was hoping for the more elegant solution.

I think this might be Watij's Achilles' Heel for my team. Otherwise,
the automation is fantastic.

Thank you both, and best regards,

Geoff

On Jun 23, 6:22 am, "Chris Hall" <chrishall...@gmail.com> wrote:
> Guys, I'm not positive, but I think that your browser.sendKeys actually gets
> directed to the parent browser window, and not the "Security Information"
> dialog.
>
> I've tried different methods of accessing it, but to no avail. The Yes()
> method in IESecurityAlertDialog looks for windows with a title of "Windows
> Internet Explorer" - maybe this is the problem?
>
> just my 2 cents...
>
> On Mon, Jun 23, 2008 at 7:19 AM, John Overbaugh <john.overba...@gmail.com>
> wrote:
>
>
>
> > Geoff,
>
> > Ironically I saw something very similar with Selenium (and firefox this
> > time). I searched and searched for an elegant solution, and finally gave up
> > and implemented the 'hacky' solution of writing code to dismiss a dialog
> > with a given name.
>
> > If you are a .NET programmer, you can implement the code I used - someone
> > on the MSDN Software Testing Forum provided sample code to look for a window
> > with a given title and dismiss it. Not sure if you can easily do this in
> > Java; I doubt it, but you might be able to. Here is the article:
>
> >http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3380783&SiteID=1
>
> > NOTE: it was really helpful to put in a 1-second thread.sleep statement at
> > the end of the search for the dialog. Saved a lot of CPU - one second is
> > nearly an eternity on a CoreDuo box, you know?
>
> > John O.
> >http://thoughtsonqa.blogspot.com
>
> > On Sun, Jun 22, 2008 at 6:56 PM, Geoff <geoffte...@gmail.com> wrote:
>
> >> Hello,
>
> >> I would like to be able to use Watij to test our Accu-Chek platform,
> >> however, I am not able to get the past the security pop-up.
>
> >> The flow is as follows:  main page, click on sign in link, enter
> >> username / password, click on sign in button, then the security pop-
> >> up.  I have tried several methods all in vein.  Can anyone tell me why
> >> my code does not work?  Better yet, give me a working example.  I
> >> would love to move past this issue and start doing some real testing
> >> with watij.
>
> >> Best regards,
> >> Geoff
>
> >> ---
>
> >> import junit.framework.TestCase;
> >> import watij.runtime.ie.IE;
> >> import static watij.finders.SymbolFactory.*;
> >> import watij.dialogs.ConfirmDialog;
>
> >> public class AccuChekTest extends TestCase {
> >>    public void testAccuChekTest() throws Exception {
> >>        final IE ie = new IE();
> >>        ie.start("http://www.accu-chek.com/us");
> >>        ie.link(text,"Sign In").click();
>
> >>        ie.textField(name,"email").set("geofftest...@yahoo.com");
> >>        ie.textField(name,"password").set("watijtest");
>
> >>        new Thread(new Runnable() {
> >>            public void run() {
> >>                try {
> >>                    ie.button("   Sign In").click();
> >>                } catch (Exception e) {
> >>                    e.printStackTrace();        }
> >>            }
>
> >>        }).start();
>
> >>        ie.sendKeys("Microsoft Internet Explorer", " ");
> >>    }
> >> }
>
> > --
> > John Overbaugh
> > blog:http://thoughtsonqa.blogspot.com- Hide quoted text -
>
> - Show quoted text -

John Overbaugh

unread,
Jun 23, 2008, 10:22:28 AM6/23/08
to wa...@googlegroups.com
I've implemented the referenced code--it doesn't run as part of my automation (again, for that project we're running Selenium with Chrome/FireFox); it sits as another application on my machine. It dismisses the window just fine. It's a hack but it unblocks me for now--once I try to move to running headless, though, I'm blocked again.

We do the best we can, eh?

John O.

guyejun

unread,
Jun 30, 2008, 8:43:50 AM6/30/08
to watij
problem :
1. showModalDialog open another showModalDialog ,we are can't
get the new showModalDialog
2: after Filedownload,we are can't get the current IE;

who can do it ?


reply me : guyej...@yahoo.com.cn

顾烨均

unread,
Jul 1, 2008, 8:18:02 PM7/1/08
to wa...@googlegroups.com

I had do with them



> Date: Mon, 30 Jun 2008 05:43:50 -0700
> Subject: Re: Help With Login Test (Popups Not Working)
> From: guyej...@hotmail.com
> To: wa...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages