If I just 'set a breakpoint' somewhere, it will run fine to that point. But - when I go to step over the line to the next line, it invariably fails.

To be concrete, if I set a breakpoint on line (b), and run, then when I get control on line (b), I step over to line (c), I get a 'WidgetNotFoundException' being thrown. If I had set the breakpoint on line (c), it would have run clean to that line.

On 03/16/2012 09:59 PM, mike fulton wrote:
> Hi
>
> I am trying to debug a simple SWTBot test and, I have found that when I
> try to single-step through the code in the JDT debugger, it fails.
> Since I am new to SWTBot, I am not sure if this is because my test is
> being written wrong, if what I am trying to do isn't supported, I need
> to set timeouts extremely large, or it's a bug in SWTBot.
> Here's a simple scenario. I try to step through this code:
>
> a) SWTBotMenu mw = bot.menu("Window").click();
> b) SWTBotMenu mp = mw.menu("Project Explorer").click();
>
> c) SWTBotMenu file = bot.menu("File");
> d) SWTBotMenu n = file.menu("New").click();
> e) SWTBotMenu p = n.menu("File").click();
>
> If I just 'set a breakpoint' somewhere, it will run fine to that point.
> But - when I go to step over the line to the next line, it invariably
> fails.
> To be concrete, if I set a breakpoint on line (b), and run, then when I
> get control on line (b), I step over to line (c), I get a
> 'WidgetNotFoundException' being thrown. If I had set the breakpoint on
> line (c), it would have run clean to that line.

As far as I know when running an swtbot test the running eclipse must
have the focus (and you should not do anything else with mouse and
keyboard); thus it might be hard to debug... Again, this is how I
understand running swtbot tests, but I might be wrong...

[quote title=Lorenzo Bettini wrote on Sat, 17 March 2012 06:03]On 03/16/2012 09:59 PM, mike fulton wrote:
> Hi
>
> I am trying to debug a simple SWTBot test and, I have found that when I
> try to single-step through the code in the JDT debugger, it fails.
> Since I am new to SWTBot, I am not sure if this is because my test is
> being written wrong, if what I am trying to do isn't supported, I need
> to set timeouts extremely large, or it's a bug in SWTBot.
> Here's a simple scenario. I try to step through this code:
>
> a) SWTBotMenu mw = bot.menu("Window").click();
> b) SWTBotMenu mp = mw.menu("Project Explorer").click();
>
> c) SWTBotMenu file = bot.menu("File");
> d) SWTBotMenu n = file.menu("New").click();
> e) SWTBotMenu p = n.menu("File").click();
>
> If I just 'set a breakpoint' somewhere, it will run fine to that point.
> But - when I go to step over the line to the next line, it invariably
> fails.
> To be concrete, if I set a breakpoint on line (b), and run, then when I
> get control on line (b), I step over to line (c), I get a
> 'WidgetNotFoundException' being thrown. If I had set the breakpoint on
> line (c), it would have run clean to that line.

As far as I know when running an swtbot test the running eclipse must
have the focus (and you should not do anything else with mouse and
keyboard); thus it might be hard to debug... Again, this is how I
understand running swtbot tests, but I might be wrong...

cheers
Lorenzo

I agree with you.
"when running an swtbot test the running eclipse must
have the focus (and you should not do anything else with mouse and
keyboard);"