Re: Navigation bar interferes with Java Robot?

58 views
Skip to first unread message

Lance

unread,
Aug 16, 2012, 5:51:38 PM8/16/12
to wa...@googlegroups.com
Marileen,

Do not take my feedback as expert advice but rather as something to try.  I have found that for all settings related to the browser that if they are not set as a static varables of the class that are being overwritten they simply do not work.  This was confusing for me as I expected the setters or the assignment of values to change the functionality but it does not.  So try something like this:

static {
   WebSpec.show_navigation_bar = false;
}

On Thursday, June 21, 2012 3:33:21 AM UTC-5, Marileen Mennerich wrote:
Hello,

I am trying to assess if Watij would suit my project's needs in terms of GUI-Testing. Right now I am writing a test to navigate our web application.
At one point I want to test the hotkey combination alt+X which should exit the current transaction and return the user to a previous menu. (The usual browser behaviour of opening a menu is suppressed by our app)
As i didn't find a way to do key presses with Watij, I use java.awt.Robot.
The problem is, that when entering the page I want to perform the Alt+x on, the focus is, by default, in the Webspec navigation bar's url field, which attracts Robot's key presses, so they never reach my app.
Sadly the page has no elements I can put the focus in before invoking the key presses.
I tried turning off the bar by using

WebSpec.show_navigation_bar(false);

but this hat no effect whatsoever. Any ideas why this might be?
Reply all
Reply to author
Forward
0 new messages