can SWTBot 2.0 test a wizard? [message #10811] |
Thu, 18 December 2008 09:43  |
Eclipse User |
|
|
|
Hi list,
I create a mini rcp application, I add a wizard
(org.eclipse.jface.wizard.Wizard), I add 2 pages
(org.eclipse.jface.wizard.WizardPage) to this wizard.
In the manually execution of my application, when I click File ->
CallWizard ,the first page of my application will open. When I setText
with label "Put here a value", buttons "<Back", "Next>" and "Finish" will
enabled. And I can click on "Next>" to open the second page of my wizard.
I want to test this application with SWTBot.
When I do in my test
bot.menu("File").menu("CallWizard").click();
I open the first page of my wizard. I type text in the textbox with no
problem.
bot.textWithLabel("Put here a value").setText("premier wizard");
But 3 buttons(back, Next and Finish) on this page are disabled. I don't
know how?
I look in the swtbot's javadoc, but I dont'see a method to enabled a
button.
I read this page
( http://swtbot.sourceforge.net/releases/1.2.0/feature-list.ht ml), I don't
see wizard. Can SWTBot 2.0 help to test a wizard?
Thanks for help.
|
|
|
Re: can SWTBot 2.0 test a wizard? [message #11921 is a reply to message #10811] |
Thu, 18 December 2008 10:46   |
Eclipse User |
|
|
|
You're probably running the test as a pde junit test instead of an
swtbot test (http://swtbot.sourceforge.net/users-guide.html)
-- Ketan
On 18/12/08 20:13, Brice Laurel wrote:
> Hi list,
>
> I create a mini rcp application, I add a wizard
> (org.eclipse.jface.wizard.Wizard), I add 2 pages
> (org.eclipse.jface.wizard.WizardPage) to this wizard.
> In the manually execution of my application, when I click File ->
> CallWizard ,the first page of my application will open. When I setText
> with label "Put here a value", buttons "<Back", "Next>" and "Finish"
> will enabled. And I can click on "Next>" to open the second page of my
> wizard.
>
> I want to test this application with SWTBot.
> When I do in my test bot.menu("File").menu("CallWizard").click();
> I open the first page of my wizard. I type text in the textbox with no
> problem.
> bot.textWithLabel("Put here a value").setText("premier wizard");
> But 3 buttons(back, Next and Finish) on this page are disabled. I don't
> know how?
> I look in the swtbot's javadoc, but I dont'see a method to enabled a
> button.
>
> I read this page
> ( http://swtbot.sourceforge.net/releases/1.2.0/feature-list.ht ml), I
> don't see wizard. Can SWTBot 2.0 help to test a wizard?
>
> Thanks for help.
>
|
|
|
|
|
|
|
Re: can SWTBot 2.0 test a wizard? [message #12046 is a reply to message #12007] |
Mon, 22 December 2008 05:43   |
Eclipse User |
|
|
|
Ketan Patel wrote:
> Need more information...do you have logging enabled...what does it say.
> Can you post your code also?
Hi Ketan Patel,
Log4j:
I copy the file
" http://swtbot.svn.sourceforge.net/svnroot/swtbot/trunk/net.s f.swtbot.finder.test/src/log4j.xml"
int the src's directory of my plugins project but I still have
log4j:WARN No appenders could be found for logger
(net.sf.swtbot.matcher.WidgetMatcherFactory$MenuMatcher).
log4j:WARN Please initialize the log4j system properly.
on my console.
Trace of my test:
My code is follow:
bot.menu("File").menu("New")menu("myRCP").click();
bot.textWithLabel("Name").setText("Anything");
bot.button("Finish").click();
bot.button("Continue").click();
In the manually execution of my RCP application, when I click on
File->New->myRCP, a new shell "shellOne" opens. On this shell, I type the
name of my component, for "exemple "Anything", then I click() on button
"Finish" and an another shell "shellTwo" is open (When I click on button
"Finish", a time is passed before "shellTwo" is open).In this state, If I
click on button "Continue" on the "shellTwo", I could do anything on my
editor.
In the test execution with SWTBot, when I run test with code below, the
execution is correct but when "shellTwo" is open, I don't have control on
this. (When I do anything on this : setText, click on a button,.. nothing
is do). I don't understand how?
Thanks in advance
|
|
|
|
Re: can SWTBot 2.0 test a wizard? [message #12097 is a reply to message #12046] |
Mon, 22 December 2008 19:28   |
Eclipse User |
|
|
|
I think you might have to wait for the "shellTwo" to be active before
trying to click on the button...something like this:
bot.button("Finish").click();
bot.shell("shellTwo").activate(); // assuming "shellTwo" is the title.
bot.button("Continue").click();
Brice Laurel wrote:
> Ketan Patel wrote:
>> Need more information...do you have logging enabled...what does it say.
>> Can you post your code also?
> Hi Ketan Patel,
> Log4j:
> I copy the file
>
" http://swtbot.svn.sourceforge.net/svnroot/swtbot/trunk/net.s f.swtbot.finder.test/src/log4j.xml"
> int the src's directory of my plugins project but I still have
> log4j:WARN No appenders could be found for logger
> (net.sf.swtbot.matcher.WidgetMatcherFactory$MenuMatcher).
> log4j:WARN Please initialize the log4j system properly.
> on my console.
> Trace of my test:
> My code is follow:
> bot.menu("File").menu("New")menu("myRCP").click();
> bot.textWithLabel("Name").setText("Anything");
> bot.button("Finish").click();
> bot.button("Continue").click();
> In the manually execution of my RCP application, when I click on
> File->New->myRCP, a new shell "shellOne" opens. On this shell, I type the
> name of my component, for "exemple "Anything", then I click() on button
> "Finish" and an another shell "shellTwo" is open (When I click on button
> "Finish", a time is passed before "shellTwo" is open).In this state, If I
> click on button "Continue" on the "shellTwo", I could do anything on my
> editor.
> In the test execution with SWTBot, when I run test with code below, the
> execution is correct but when "shellTwo" is open, I don't have control on
> this. (When I do anything on this : setText, click on a button,.. nothing
> is do). I don't understand how?
> Thanks in advance
|
|
|
Re: can SWTBot 2.0 test a wizard? [message #12110 is a reply to message #12097] |
Tue, 23 December 2008 04:05  |
Eclipse User |
|
|
|
Hi ketan Patel,
The same problem persist. "ShellTwo" is a shell which don't have a title.
I type
bot.button("Finish").click();
Thread.sleep(2000);
bot.shell("").activate();
bot.button("Continue").click();
Because in the manually execution, when I click on "Finish", a time is
passed before "shellTwo" is open.
But I have the same problem in the test execution with SWTBot (I don't
have any control on "shellTwo").
Thanks in advance.
|
|
|
Powered by
FUDForum. Page generated in 0.04180 seconds