|
Re: SWTBot has different behaviour depending if the window is top-most or not [message #560422 is a reply to message #559347] |
Tue, 21 September 2010 15:11 |
Ketan Padegaonkar Messages: 873 Registered: July 2009 |
Senior Member |
|
|
If I understand correctly, the problem is that the eclipse window is not
the window on top causing tests to fail. One way to fix this is to force
focus when the tests run in headless mode.
class AllTests {
static {
bot.shell('window title').setFocus();
}
}
I've also noticed at times that this does not actually force focus on
the window, but rather alerts the user via a blinking taskbar that the
window needs attention. There's always autoit
(http://www.autoitscript.com/autoit3/index.shtml) for such those weird
windows 'features'.
--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot
On 9/16/10 5:57 AM, Gabriel Petrovay wrote:
> Hi Ketan,
>
> I have a test suite that when I start by hand from Eclipse runs
> successfully. But when I run it from a task (Windows' Task Scheduler)
> the some tests constantly fail.
>
> One such problem is because the Window is not top-most when started from
> the Task Scheduler. To simplify this, this test also fails if you start
> it from Eclipse and you make another windows top-most such that the
> Eclipse SWTBot starts is not any more the top-most one.
>
> The test fails because of the timeout waiting for a shell to be active:
>
> bot.waitUntil(Conditions.shellIsActive("Errors in Workspace"));
>
> But since the focus is on another window, the shell will never be active
> (having focus).
>
> Consider that you have all these pop-ups in Eclipse like "Do you want to
> open the associated perspective?", "Save file", "Errors in Workspace",
> etc. that tou want to close. Do you know ways to work around this "sleep
> until active" condition? More precisely, to make the tests independent
> of whether the window is top most or not.
>
> I can not control how the Eclipse application started (top-most or not).
> In my scenario Task Scheduler calls a batch script. This calls the ant
> batch script available in the eclipse/plugins/org.apache.ant.../bin. And
> this loads the tests.xml ant script that contains the target as
> described on the page http://wiki.eclipse.org/SWTBot/Ant#Ant .
>
>
> Regards,
> Gabriel
|
|
|
Re: SWTBot has different behaviour depending if the window is top-most or not [message #623619 is a reply to message #559347] |
Wed, 22 September 2010 02:26 |
Ketan Padegaonkar Messages: 873 Registered: July 2009 |
Senior Member |
|
|
If I understand correctly, the problem is that the eclipse window is not
the window on top causing tests to fail. One way to fix this is to force
focus when the tests run in headless mode.
class AllTests {
static {
bot.shell('window title').setFocus();
}
}
I've also noticed at times that this does not actually force focus on
the window, but rather alerts the user via a blinking taskbar that the
window needs attention. There's always autoit
(http://www.autoitscript.com/autoit3/index.shtml) for such those weird
windows 'features'.
--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot
On 9/16/10 5:57 AM, Gabriel Petrovay wrote:
> Hi Ketan,
>
> I have a test suite that when I start by hand from Eclipse runs
> successfully. But when I run it from a task (Windows' Task Scheduler)
> the some tests constantly fail.
>
> One such problem is because the Window is not top-most when started from
> the Task Scheduler. To simplify this, this test also fails if you start
> it from Eclipse and you make another windows top-most such that the
> Eclipse SWTBot starts is not any more the top-most one.
>
> The test fails because of the timeout waiting for a shell to be active:
>
> bot.waitUntil(Conditions.shellIsActive("Errors in Workspace"));
>
> But since the focus is on another window, the shell will never be active
> (having focus).
>
> Consider that you have all these pop-ups in Eclipse like "Do you want to
> open the associated perspective?", "Save file", "Errors in Workspace",
> etc. that tou want to close. Do you know ways to work around this "sleep
> until active" condition? More precisely, to make the tests independent
> of whether the window is top most or not.
>
> I can not control how the Eclipse application started (top-most or not).
> In my scenario Task Scheduler calls a batch script. This calls the ant
> batch script available in the eclipse/plugins/org.apache.ant.../bin. And
> this loads the tests.xml ant script that contains the target as
> described on the page http://wiki.eclipse.org/SWTBot/Ant#Ant .
>
>
> Regards,
> Gabriel
|
|
|
|
Powered by
FUDForum. Page generated in 0.05513 seconds