Login Check in SWTBOT Against RCP [message #531843] |
Thu, 06 May 2010 07:05  |
Eclipse User |
|
|
|
Hi All,
I have a scenario like
I need to check the login for a RCP based application.
I have created a class, which contains SWTBOT features.
I have created one method too like .
public void testOpenAnotherView ()throws Exception{
System.out.println("Inside testOpenAnotherView ");
bot.textWithLabel("User-ID").setText("username");
bot.textWithLabel("Password").setText("password");
bot.button("Login").click();
System.out.println("Exit testOpenAnotherView ");
}
I have run the class against the RCP product. The application Loginpage loads
But it was not loging in, Even i am not recieving the System.out.println.
Please let me know what will be the issue.
Please help in resolving the issue.
Thanks and Regards,
Yogeshkumar.S
|
|
|
Re: Login Check in SWTBOT Against RCP [message #531890 is a reply to message #531843] |
Thu, 06 May 2010 09:05   |
Eclipse User |
|
|
|
yogeshkumar wrote:
> Hi All,
>
> I have a scenario like
> I need to check the login for a RCP based application.
>
> I have created a class, which contains SWTBOT features.
>
> I have created one method too like .
>
> public void testOpenAnotherView ()throws Exception{
> System.out.println("Inside testOpenAnotherView ");
> bot.textWithLabel("User-ID").setText("username");
> bot.textWithLabel("Password").setText("password");
> bot.button("Login").click();
> System.out.println("Exit testOpenAnotherView ");
> }
>
> I have run the class against the RCP product. The application Loginpage
> loads
>
> But it was not loging in, Even i am not recieving the System.out.println.
>
> Please let me know what will be the issue.
>
> Please help in resolving the issue.
>
> Thanks and Regards,
> Yogeshkumar.S
>
If I understand correctly your problem, you have to login before using
the RCP application, right? You get a login screen, then if you are
correctly logged-in the RCP application start.
However, this is not possible to test with SWTBot because of the
internal mechanics of Eclipse/RCP/OSGi. For your test case to run, the
RCP application must be running.
To make things clearer (I hope), here is a "diagram":
Loginpage ---launch---> RCP (OSGi runtime) ---launch---> SWTBot tests
The usual workaround for this is to deactivate login while you test, or
to log in using command-line argument (if it's supported by your
application).
Hope this helps.
--
Pascal Gélinas | Software Developer
*Nu Echo Inc.*
http://www.nuecho.com/ | http://blog.nuecho.com/
*Because performance matters.*
|
|
|
|
|
|
Re: Login Check in SWTBOT Against RCP [message #533174 is a reply to message #533104] |
Wed, 12 May 2010 09:40  |
Eclipse User |
|
|
|
Two ways:
1. Look at the junit view, it tells you how long each test method took!
2. Use system outs:
long start = System.currentTimeMillis();
.....
doSomething();
.....
long end = System.currentTimeMillis();
System.out.println("Execution time was "+(end-start)+" ms.");
--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot
On 5/12/10 2:21 AM, yogeshkumar wrote:
> Dear Ketan,
>
> Is there any way in SWTBOT to log the time taken for the test case? or
> to log the time taken for the operation.
>
> Ex: time taken to open a new file.
>
> Thanks and Regards,
> Yogeshkumar.S
>
|
|
|
Powered by
FUDForum. Page generated in 0.07113 seconds