Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Jubula » Cannot activate app with modal login
icon5.gif  Cannot activate app with modal login [message #786497] Mon, 30 January 2012 13:55 Go to next message
Terry Child is currently offline Terry ChildFriend
Messages: 4
Registered: January 2012
Junior Member
Hi All

I've just started using Jubula and I'm impressed with how easy it is to use.

However, I've run into a small snag:

I'm trying to use ub_app_activate_AUTDefault to activate a swing application that has a modal 'login' dialog i.e. as soon as the application launches it displays a modal login dialog in front of the main application window.

Jubula clicks on the application and it is activated i.e. the app shows, and the modal dialog has the focus - this is the desired behaviour.

But it then says that it has failed - I guess because the modal login dialog has taken the focus from the main application window.

I'm using:

Jubula ITE 1.1
Windows Vista (I know).
A Swing app launched from a batch file.

If I remove the activation step it works fine - but I need to include this as I need to test several applications using multiple Test Suites in a Test Job.

Can anyone suggest a work-around for this?

Regards

Terry Child
Re: Cannot activate app with modal login [message #787342 is a reply to message #786497] Tue, 31 January 2012 13:24 Go to previous messageGo to next message
Oliver Goetz is currently offline Oliver GoetzFriend
Messages: 112
Registered: May 2011
Senior Member
Hi,

have you tried to use different methods of activating the AUT? You can find details for ub_app_activate_AUT here. Maybe this solves the problem.
Regards
Oliver
Re: Cannot activate app with modal login [message #787363 is a reply to message #787342] Tue, 31 January 2012 13:57 Go to previous messageGo to next message
Terry Child is currently offline Terry ChildFriend
Messages: 4
Registered: January 2012
Junior Member
Hi Oliver

Thanks for the reply.

The application does activate OK (it gains the focus) - it's just that ub_app_activate_AUT then says that activation has failed.

I guess that the underlying code is testing to see if the application's main window has the focus after it has 'clicked' on the titlebar.

Unfortunately it doesn't - because focus is stolen by the modal login prompt.

As a work around I've created a TestCase that activates the app and has an event handler to deal with the failure - it just has a Reentry type of CONTINUE.

(I could not find a 'null' TestCase for the event handler so I used ub-app_checkNumericValues with hard-wired params of 1 and 1 - so it never fails).

This is not ideal - as the test suite still ends up with Red Crosses in the results.

Maybe the ub_app_activate_AUT code could be tweaked so it checks to see if a child window of the application has the focus?

Cheers

Terry Child
Re: Cannot activate app with modal login [message #787404 is a reply to message #787363] Tue, 31 January 2012 14:42 Go to previous messageGo to next message
Achim Loerke is currently offline Achim LoerkeFriend
Messages: 357
Registered: July 2009
Location: Braunschweig, Germany
Senior Member

Hi,

the ub_app_activate_AUT module is supposed to check (and eventually fail) for focus. If you want just an "click and ignore the result" approach you can define an activation method in the expert section of the AUT configuration dialog. This activation is done at the start of a TestSuite but its success is not checked.

Achim
Re: Cannot activate app with modal login [message #787570 is a reply to message #787404] Tue, 31 January 2012 18:35 Go to previous messageGo to next message
Terry Child is currently offline Terry ChildFriend
Messages: 4
Registered: January 2012
Junior Member

Hi Achim

Defining an activation method in the expert section of the AUT configuration dialog works when I run my TestJob from the ITE.

But I'm trying to use ant to get Jubula to run a TestJob containing TestSuites for three different swing applications as part of a continuous integration build.

I have an ant script which launches each application using autrun (with autids) and then launches testexec to run the testjob.

Unfortunately the applications don't get the focus in these circumstances - unless I use my activation+event_handler work around - which seems like a kludge.

Cheers

Terry Child


Re: Cannot activate app with modal login [message #787955 is a reply to message #787570] Wed, 01 February 2012 07:03 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi Terry,

I have a couple of pointers that may help you further -

In normal circumstances where there are multiple AUTs, the "click in active window" failure is exactly what you need to find out that the AUT you want to test next isn't there. You can react to this by switching between AUTs and then try again until you get the right one. This is described in this blog entry and there's a forum discussion about it here.

In your case, though, it could be that the correct application is there, but the login dialog is blocking us knowing that (I've seen applications where this method works, though, even if a login dialog was present).

If you are logging in with the same user for all AUT instances, then you could react to the failure of the click by logging in and retrying the click. If you're using different users, another suggestion would be to see if the AUTs can be started pre-logged in with the users you need - perhaps the AUT can take a command line argument to do this?

Hope this information helps a bit,
Alex
Re: Cannot activate app with modal login [message #788531 is a reply to message #786497] Wed, 01 February 2012 23:09 Go to previous messageGo to next message
Terry Child is currently offline Terry ChildFriend
Messages: 4
Registered: January 2012
Junior Member
It works!

I followed Achim's advice and removed the ub_app_activate_AUT references from my test cases.

I then read Alex's blog and realised that I was using the AUT IDs from my existing configurations in my autrun commands - instead of creating new ones.

I changed the AUT IDs for the autrun commands to be of the form 'MYAPP_autrun' and then entered these into the "AUT IDs for AUTs started with autrun" section of my existing AUT definitions.

I then updated the TestSuites in my TestJob to use the new AUT IDs and when I now run it using testexec all the tests are run correctly and the apps activate when needed.

(I didn't need to follow the "Switching between applications" section of the blog)

Many Thanks!

Terry

Re: Cannot activate app with modal login [message #788733 is a reply to message #788531] Thu, 02 February 2012 06:28 Go to previous message
Achim Loerke is currently offline Achim LoerkeFriend
Messages: 357
Registered: July 2009
Location: Braunschweig, Germany
Senior Member

Happy it worked.

Thanks for the feedback

Achim
Previous Topic:AUT could not be started, because no valid Java JRE was specified
Next Topic:Event Handler = Failed test case
Goto Forum:
  


Current Time: Sun Dec 21 10:45:19 GMT 2014

Powered by FUDForum. Page generated in 0.02310 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software