Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jubula-rc-dev] Problem executing action in tester class

Hi,

 

Any pointers / suggestions?

 

Thanks and Regards.

         Yuvraj


From: jubula-rc-dev-bounces@xxxxxxxxxxx [jubula-rc-dev-bounces@xxxxxxxxxxx] on behalf of Yuvraj Nigade [yuvraj_nigade@xxxxxxxxxxxxxxxx]
Sent: Tuesday, December 03, 2013 6:40 PM
To: Jubula remote control components development
Subject: Re: [jubula-rc-dev] Problem executing action in tester class

Hi,

 

Here are my findings so far,

 

Approach 1=>

 

<concreteComponent type="AppLauncher" hasDefaultMapping="true">

    <extends>guidancer.concrete.GraphicApplication<extends>

    <testerClass>org.eclipse.jubula.rc.swing.tester.AppTester</testerClass>

    <action name="CompSystem.LaunchApp" >

        <method>startApplication</method>

    </action>

</toolkitComponent>

 

This will add 'Launch App' option under existing component 'Application'. However, for two possible reasons my 'startApplication' action doesn't get executed - 1> 'concreteComponent' doesn't recognise 'testerClass' element tag     2> For class 'guidancer.concrete.GraphicApplication' there is already a tester class associated, which is 'org.eclipse.jubula.rc.swing.tester.SwingApplicationTester' and thus Jubula ignores my tester class. I say this because of error I see in log file rc_swing.log,  No such accessible method: startApplication() on object: org.eclipse.jubula.rc.swing.tester.SwingApplicationTester.

 

Conclusion : Not the right thing to do. Must adhere to using toolkitComponent.

 

Approach 2=>

 

 <toolComponent type="AppLauncher" hasDefaultMapping="true">

        <extends>guidancer.concrete.GraphicApplication<extends>

        <testerClass>org.eclipse.jubula.rc.swing.tester.AppTester</testerClass>

        <action name="CompSystem.LaunchApp" >

            <method>startApplication</method>

        </action>

 </toolkitComponent>

 

This also adds 'Launch App' option under existing component 'Application'. However, the action 'startApplication' is not getting executed, citing same error in rc_swing.log i.e. No such accessible method: startApplication() on object: org.eclipse.jubula.rc.swing.tester.SwingApplicationTester. I guess this is too because for class 'guidancer.concrete.GraphicApplication' there is already a tester class associated, which is 'org.eclipse.jubula.rc.swing.tester.SwingApplicationTester' and thus Jubula ignores my tester class.

 

Conclusion : If this approach is correct, is there any way to make Jubula to recognise my tester class instead of SwingApplicationTester? If not then not a right approach.

 

 

Approach 3=>

 

<toolComponent type="AppLauncher" hasDefaultMapping="true">

    <testerClass>org.eclipse.jubula.rc.swing.tester.AppTester</testerClass>

    <action name="CompSystem.LaunchApp" >

        <method>startApplication</method>

    </action>

</toolkitComponent>

 

This requires 'depends' property of 'toolkit' extension point in plugin.xml to be set to either com.bredexsw.guidancer.ConcreteToolkitPlugin or com.bredexsw.guidancer.SwingToolkitPlugin. Otherwise the component is not visible in the list of new test steps. If this is taken care of, the component is visible and one can add it as new test step. However, during the execution two errors are seen in rc_swing.log depending on what value is set for 'depends'

 

    1> If 'depends' is com.bredexsw.guidancer.ConcreteToolkitPlugin, the error in log file is

                2013-12-03 17:50:04.166 [Connection.ReaderThread:Socket[addr=LAP932.persistent.co.in/10.77.235.2,port=56729,localport=56745]] ERROR o.e.j.r.c.c.AbstractCapTestCommand - component ''is not supported
            org.eclipse.jubula.rc.common.exception.UnsupportedComponentException: component '' is not supported
                 at org.eclipse.jubula.rc.common.AUTServerConfiguration.createInstance(AUTServerConfiguration.java:318) ~[org.eclipse.jubula.rc.common_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.rc.common.AUTServerConfiguration.getImplementationClass(AUTServerConfiguration.java:261) ~[org.eclipse.jubula.rc.common_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.rc.common.commands.AbstractCapTestCommand.getImplClass(AbstractCapTestCommand.java:140) [org.eclipse.jubula.rc.common_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.rc.common.commands.AbstractCapTestCommand.execute(AbstractCapTestCommand.java:234) [org.eclipse.jubula.rc.common_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.communication.Communicator$ConnectionListener.received(Communicator.java:844) [org.eclipse.jubula.communication_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.communication.connection.Connection.fireMessageReceived(Connection.java:402) [org.eclipse.jubula.communication_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.communication.connection.Connection.access$2(Connection.java:391) [org.eclipse.jubula.communication_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.communication.connection.Connection$ReaderThread.run(Connection.java:454) [org.eclipse.jubula.communication_2.2.0.201310100933.jar:na]

 

     2> If 'depends' is com.bredexsw.guidancer.SwingToolkitPlugin, the error in log file is

 

                2013-12-03 17:38:02.496 [Connection.ReaderThread:Socket[addr=LAP932.persistent.co.in/10.77.235.2,port=65129,localport=65148]] ERROR o.e.j.r.c.c.AbstractCapTestCommand - null
java.lang.NullPointerException: null
                 at org.eclipse.jubula.rc.common.classloader.ImplClassClassLoader.implLoadClass(ImplClassClassLoader.java:91) ~[org.eclipse.jubula.rc.common_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.rc.common.classloader.ImplClassClassLoader.loadClass(ImplClassClassLoader.java:62) ~[org.eclipse.jubula.rc.common_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.rc.common.classloader.ImplClassClassLoader.loadClass(ImplClassClassLoader.java:107) ~[org.eclipse.jubula.rc.common_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.rc.common.AUTServerConfiguration.loadImplementationClass(AUTServerConfiguration.java:340) ~[org.eclipse.jubula.rc.common_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.rc.common.AUTServerConfiguration.createInstance(AUTServerConfiguration.java:292) ~[org.eclipse.jubula.rc.common_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.rc.common.AUTServerConfiguration.getImplementationClass(AUTServerConfiguration.java:261) ~[org.eclipse.jubula.rc.common_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.rc.common.commands.AbstractCapTestCommand.getImplClass(AbstractCapTestCommand.java:140) [org.eclipse.jubula.rc.common_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.rc.common.commands.AbstractCapTestCommand.execute(AbstractCapTestCommand.java:234) [org.eclipse.jubula.rc.common_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.communication.Communicator$ConnectionListener.received(Communicator.java:844) [org.eclipse.jubula.communication_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.communication.connection.Connection.fireMessageReceived(Connection.java:402) [org.eclipse.jubula.communication_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.communication.connection.Connection.access$2(Connection.java:391) [org.eclipse.jubula.communication_2.2.0.201310100933.jar:na]
                 at org.eclipse.jubula.communication.connection.Connection$ReaderThread.run(Connection.java:454) [org.eclipse.jubula.communication_2.2.0.201310100933.jar:na]

 

 

Conclusion: Looks like a right approach for my need. Need to solve any one of the above errors.

 

 

Following are the contents of my adapter file=>


package org.eclipse.jubula.rc.common.adapter;

import org.eclipse.jubula.rc.common.adaptable.IAdapterFactory;

import org.eclipse.jubula.rc.common.tester.adapter.interfaces.IComponent;

 

public class AppAdapter implements IAdapterFactory{

    public Class[] getSupportedClasses() {

        return new Class[] { Object.class };

    }

 

    public Object getAdapter(Class targetAdapterClass, Object objectToAdapt) {

        // TODO Auto-generated method stub

        if (targetAdapterClass.isAssignableFrom(IComponent.class)) {

            return objectToAdapt;

       }

 

        return null;

    }

}

 

Following are the contents of my tester file=>

 

package org.eclipse.jubula.rc.swing.tester;

import org.eclipse.jubula.rc.common.exception.StepExecutionException;
import org.eclipse.jubula.rc.common.tester.AbstractUITester;

 

public class AppTester extends AbstractUITester{
 
     public void startApplication() throws StepExecutionException{
          System.out.println("Start Application");
     }

 

    public String[] getTextArrayFromComponent() {
          // TODO Auto-generated method stub
      return null;
 }

}

Please let me know if anybody has any suggestions and if anything is wrong with my above findings. Appreciate your help.

 

Thanks and Regards.

            Yuvraj

 

 


From: jubula-rc-dev-bounces@xxxxxxxxxxx [jubula-rc-dev-bounces@xxxxxxxxxxx] on behalf of Yuvraj Nigade [yuvraj_nigade@xxxxxxxxxxxxxxxx]
Sent: Monday, December 02, 2013 2:44 PM
To: Jubula remote control components development
Subject: Re: [jubula-rc-dev] Problem executing action in tester class

Thanks Alejo for pointing out the mistake. I have rectified the mistake. I have also changed minimum Java environment needed to 1.5 in my RC's manifest. Earlier it was 1.7. However, I am still seeing the same error. I haven't provided any implemention for IAdapterFactory. Could that be the reason? Do I need to provide it in my case, even if I just want to lauch an application using my extension and not looking for providing support for any custom UI component. Also, is 'testerClass' element allowed under 'concreteComponent'? I am using Jubula 2.2 and I have based my RC on org.eclipse.jubula.rc.common. Is it fine? Please let me know if you see any possible problems with my approach.
 
Thanks and Regards.
        Yuvraj
 

From: jubula-rc-dev-bounces@xxxxxxxxxxx [jubula-rc-dev-bounces@xxxxxxxxxxx] on behalf of Alejo Abdala [alejo.abdala@xxxxxxxxxxxx]
Sent: Friday, November 29, 2013 9:57 PM
To: Jubula remote control components development
Subject: Re: [jubula-rc-dev] Problem executing action in tester class

Hello Yuvraj, you need to make the startApplication method public.
public void startApplication() throws ... {...}

Cheers


On Fri, Nov 29, 2013 at 1:21 PM, Yuvraj Nigade <yuvraj_nigade@xxxxxxxxxxxxxxxx> wrote:

Hi,

 

I have successfully implemented a toolkit plugin to extend concrete component 'Application'. I am able to see my new action added under 'Application' component while adding 'New Test Step'. Below is my ComponentConfiguration.xml content -

 

<concreteComponent type="AROLauncher" hasDefaultMapping="true">

    <extends>guidancer.concrete.GraphicApplication</extends>

    <testerClass>org.eclipse.jubula.rc.swing.tester.AppTester</testerClass>

    <action name="CompSystem.LaunchARO" >

        <method>startApplication</method>

    </action>

</concreteComponent>

 

I am able to add this new action as a test step for a test case. However, when I execute the test suite, the action added by me fails citing below error -

 

2013-11-29 20:45:27.112 [Connection.ReaderThread:Socket[addr=LAP932.persistent.co.in/10.77.235.2,port=50290,localport=50305]] ERROR o.e.j.r.c.c.AbstractCapTestCommand - implementation class method not found
java.lang.NoSuchMethodException: No such accessible method: startApplication() on object: org.eclipse.jubula.rc.swing.tester.SwingApplicationTester

 

The error is pretty much clear that it could locate my method. However, I am not able to figure out the reason for this. Below are the contents of my tester class -

 

package

org.eclipse.jubula.rc.swing.tester;

import

java.awt.Rectangle;

import

org.eclipse.jubula.rc.common.driver.IRobot;

import

org.eclipse.jubula.rc.common.exception.StepExecutionException;

import

org.eclipse.jubula.rc.common.tester.AbstractApplicationTester;

 

public

class AppTester extends AbstractApplicationTester{

void startApplication() throws StepExecutionException{

rcExecuteExternalCommand(

"C:\\Program Files\\Notepad++\\notepad++.exe", 0, true, 5000);

}

public String[] getTextArrayFromComponent() {

// TODO Auto-generated method stub

return null;

}

public Rectangle getActiveWindowBounds() {

// TODO Auto-generated method stub

return null;

}

protected IRobot getRobot() {

// TODO Auto-generated method stub

return null;

}

public void rcKeyStroke(String modifierSpec, String keySpec) {

// TODO Auto-generated method stub

}

protected Object getFocusOwner() {

// TODO Auto-generated method stub

return null;

}

protected int getEventCode(int key) {

// TODO Auto-generated method stub

return 0;

}

protected Object getActiveWindow() {

// TODO Auto-generated method stub

return null;

}

}

 

Is anything wrong in above code? I looked at xml schema definition for concreteComponent and there is not testerClass child element defined for it. Could that be the reason? Should I change it to toolkitComponent?

 

One more thing is that, I haven't provided any implemention for IAdapterFactory? Do still I need to provide it in my case, as I just want to lauch an application using my extension and not looking for providing support for any custom UI component? Please let me know. Thanks in advance for your help.

 

Thanks and Regards.

          Yuvraj

DISCLAIMER ========== This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.


_______________________________________________
jubula-rc-dev mailing list
jubula-rc-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jubula-rc-dev


DISCLAIMER ========== This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

DISCLAIMER ========== This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

DISCLAIMER ========== This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.


Back to the top