Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Login Check in SWTBOT Against RCP(Login Check in SWTBOT Against RCP)
Login Check in SWTBOT Against RCP [message #531843] Thu, 06 May 2010 11:05 Go to next message
yogeshkumar  is currently offline yogeshkumar Friend
Messages: 22
Registered: April 2010
Junior Member
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 13:05 Go to previous messageGo to next message
Pascal G is currently offline Pascal GFriend
Messages: 157
Registered: July 2009
Senior Member
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 #532472 is a reply to message #531890] Mon, 10 May 2010 07:58 Go to previous messageGo to next message
yogeshkumar  is currently offline yogeshkumar Friend
Messages: 22
Registered: April 2010
Junior Member
Hi All,

I am getting error when I run my SWTBOT code.

Exception in thread "WorkbenchTestable" java.lang.IllegalArgumentException: No Classloader found for plug-in SampleSWTBotExample
at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.getCl assLoader(RemotePluginTestRunner.java:79)
at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.getTe stClassLoader(RemotePluginTestRunner.java:73)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadC lass(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadC lasses(RemoteTestRunner.java:425)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:445)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)

Please help me in fixing this issue.

Thanks and Regards,
Yogeshkumar.S

[Updated on: Mon, 10 May 2010 08:09]

Report message to a moderator

Re: Login Check in SWTBOT Against RCP [message #532645 is a reply to message #532472] Mon, 10 May 2010 15:59 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
Could you provide the full stack trace ?

I don't mean to be rude at this point, but I feel that you should call
up someone on your development team to sort this out.

These are 'regular hiccups' when new users start doing eclipse
development(or testing), and they go away once you know which knobs to
turn to fix some configuration.

I'd encourage you to download a fresh version of the eclipse rcp SDK[1]
and go through the tutorial at http://swtbot.org/user-guide/

--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot

[1] - http://goo.gl/vkie

On 5/10/10 12:58 AM, yogeshkumar wrote:
> Hi All,
>
> I am getting error when I run my SWTBOT code.
>
> Exception in thread "WorkbenchTestable"
> java.lang.IllegalArgumentException: No Classloader found for plug-in
> Please help me in fixing this issue.
>
> Thanks and Regards,
> Yogeshkumar.S
>
>
Re: Login Check in SWTBOT Against RCP [message #533104 is a reply to message #532645] Wed, 12 May 2010 09:21 Go to previous messageGo to next message
yogeshkumar  is currently offline yogeshkumar Friend
Messages: 22
Registered: April 2010
Junior Member
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
Re: Login Check in SWTBOT Against RCP [message #533174 is a reply to message #533104] Wed, 12 May 2010 13:40 Go to previous message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
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
>
Previous Topic:Assert failed trying to navigate a tree
Next Topic:Waiting for workspace in SWTBotTest
Goto Forum:
  


Current Time: Mon Dec 22 02:58:29 GMT 2014

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

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