Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Jubula » Cross-platform (Linux-Windows) RCP testing
Cross-platform (Linux-Windows) RCP testing [message #1717483] Mon, 14 December 2015 10:44 Go to next message
Luca Da Rin Fioretto is currently offline Luca Da Rin FiorettoFriend
Messages: 8
Registered: November 2015
Junior Member
Hello everyone,

I'm testing a RCP application, all the UI elements I have mapped in Jubula have been mapped on a Linux system (running the Linux version of the RCP application).

Now when I try to use the same test database to launch the tests on Windows (running the Windows version of the RCP application) the buttons results mapped "incorrectly" as the arrangement of some buttons in dialog boxes differs between Linux and Windows, that's probably due to how the SWT module builds the UI in a "per OS" manner.

For instance, the following images shows the difference between Windows and Linux arrangements respectively:
index.php/fa/24305/0/
index.php/fa/24306/0/

The following image shows Jubula's Object Mapper when capturing the "Debug" button on Linux:
index.php/fa/24308/0/

And when capturing the "Debug" and "Close" buttons, respectively, on Windows:
index.php/fa/24309/0/
index.php/fa/24307/0/

As you can see from the images, the buttons result "swapped" on Windows in respect to Linux. So when I run tests on Windows, Jubula clicks on the "wrong" button, in this case, Jubula will click on the "Close" button instead of "Debug" and vice-versa.

What would be the best approach to overcome this issue?

Thank you.

[Updated on: Mon, 14 December 2015 10:46]

Report message to a moderator

Re: Cross-platform (Linux-Windows) RCP testing [message #1717503 is a reply to message #1717483] Mon, 14 December 2015 12:26 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
Hi there,

Thanks for the good description.

In the AUT Definition Dialog there is an option to generate names for components. You should have this option set to "on" before you map components (you should restart the AUT first) - this should lead to the components being found correctly on cross platform scenarios.

Another option is to name the components using setData();

As of the next beta version (January) it will also be possible to set individual mappings to use a different recognition profile (so that you can name certain components, and then search for them only by name).

Hope this information helps!
Alex
Re: Cross-platform (Linux-Windows) RCP testing [message #1717519 is a reply to message #1717503] Mon, 14 December 2015 14:26 Go to previous messageGo to next message
Luca Da Rin Fioretto is currently offline Luca Da Rin FiorettoFriend
Messages: 8
Registered: November 2015
Junior Member
Alexandra Schladebeck wrote on Mon, 14 December 2015 12:26
Hi there,

Thanks for the good description.

In the AUT Definition Dialog there is an option to generate names for components. You should have this option set to "on" before you map components (you should restart the AUT first) - this should lead to the components being found correctly on cross platform scenarios.


Thank you for the quick reply Alexandra. The option you mentioned was "on" already since I started mapping objects.

Alexandra Schladebeck wrote on Mon, 14 December 2015 12:26

Another option is to name the components using setData();


We tried that but it seems that Jubula doesn't pick it up : /

Alexandra Schladebeck wrote on Mon, 14 December 2015 12:26

As of the next beta version (January) it will also be possible to set individual mappings to use a different recognition profile (so that you can name certain components, and then search for them only by name).

Hope this information helps!
Alex


That's nice!

Any other idea why am I getting this behaviour? I find it weird that it seems nobody else experienced something like that on the forum... : /

Luca
Re: Cross-platform (Linux-Windows) RCP testing [message #1717526 is a reply to message #1717519] Mon, 14 December 2015 15:07 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
Hi Luca,

It looks like I missed some important information - you need to use a specific key, as described here:
http://help.eclipse.org/mars/topic/org.eclipse.jubula.client.ua.help/content/html/userManual/toolkit/rcpAUT/design-for-testability-in-rcp.html?cp=44_3_2_4

Sorry about that!

It is somewhat weird that the generate names option doesn't seem to work for this situation. Are you starting the AUT via a configuration, autrun, or a launch configuration?
Feel free to put a bug entry in describing the situation and adding screenshots of the properties view for both versions of the component (as above). Maybe we don't do this for all situations yet.

Hopefully the setData(); option should help you in this case though - keep us posted.

Best regards,
Alex
Re: Cross-platform (Linux-Windows) RCP testing [message #1717542 is a reply to message #1717526] Mon, 14 December 2015 16:05 Go to previous messageGo to next message
Kevin Mills is currently offline Kevin MillsFriend
Messages: 8
Registered: July 2011
Junior Member
Hi Alex,

We'd like to use the setData() solution but the dialog in question is being inherited from the base eclipse platform (which we are not building from source) so I don't have legit access to the button objects in order to set their names at instantiation time. I've tried less-legit methods using reflection and granting access to private members after the fact, then calling setData(TEST_COMP_NAME,"name") on them. (I'd rather not do this, but I had to as an experiment to see if we could work around this issue.) The call seems to work, but I think it might be too late as it appears that Jubula may have already queried the button for a name before I am able to set it. (I don't know this definitively. It's just a theory at this point. But the name is not being recognized in the Object Mapper.)

-Kevin
Re: Cross-platform (Linux-Windows) RCP testing [message #1717591 is a reply to message #1717542] Tue, 15 December 2015 06:53 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
Hi Kevin,

Thanks for the information. Based on what you're saying, I'd say it makes sense to enter a ticket about the behaviour. I'll have someone check it out and see what can be done about it.
If it's at all possible to point to an example (either one already in Eclipse, or one you add to the ticket), then that would help a lot. Please also add the usual info (Eclipse version, SWT version, ...)
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Jubula

Thanks!
Alex
Re: Cross-platform (Linux-Windows) RCP testing [message #1717688 is a reply to message #1717591] Tue, 15 December 2015 21:37 Go to previous messageGo to next message
Kevin Mills is currently offline Kevin MillsFriend
Messages: 8
Registered: July 2011
Junior Member
Hi Alex,

We were looking into finding an example of the inconsistent behavior in a baseline eclipse installation and noticed that it appears that standard dialog buttons get generated technical names that correspond to constant ID values from IDialogConstants (with names of the form "dialog.button.<name>" where name looks to be extracted from the names defined in IDialogLabelKeys). Can you confirm (or deny) this? I just want to make sure that I don't spend more time with standard dialog buttons if they get generated technical names via a special mechanism. In looking at the source code that creates these standard buttons I can see that setData("TEST_COMP_NAME,"???") is not being used, but setData(IDialogConstant.???) is being called.

Thanks!
Kevin
Re: Cross-platform (Linux-Windows) RCP testing [message #1717702 is a reply to message #1717688] Wed, 16 December 2015 07:05 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
Hi Kevin,

I'm not 100% sure of the technical realisation of it, but yes, standard dialog buttons are indeed given names (this is what the "generate names" flag does - and we introduced it to deal woth OK and cancel buttons on different platforms).

Hope that helps!
Alex
Re: Cross-platform (Linux-Windows) RCP testing [message #1717762 is a reply to message #1717702] Wed, 16 December 2015 14:51 Go to previous messageGo to next message
Kevin Mills is currently offline Kevin MillsFriend
Messages: 8
Registered: July 2011
Junior Member
Hi Alex,

Thanks for the clarification. That is probably a good indicator that the "cancel" button we are having a problem with is not standard dialog button so the "generate technical names" option isn't useful in this case.

Is there maybe a way to identify a UI button by it's text (i.e. the text displayed on the button)?

-Kevin
Re: Cross-platform (Linux-Windows) RCP testing [message #1717764 is a reply to message #1717762] Wed, 16 December 2015 15:00 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
Hi Kevin,

That's not a method currently supported by Jubula I'm afraid. We used to be somewhat against it due to AUTs running in different languages, but time has shown that functional testing through the UI is hardly ever run in different languages (we're actually in the process of removing the multi-language support). We'd probably want to make it an object mapping option / allow an action to click a specific text / an item based on a property. I have some doubts how quickly it may happen from our side, but you could think about writing an extension for it - we'd certainly be interested in reviewing it.

Best regards,
Alex
Re: Cross-platform (Linux-Windows) RCP testing [message #1717904 is a reply to message #1717764] Thu, 17 December 2015 16:07 Go to previous messageGo to next message
Kevin Mills is currently offline Kevin MillsFriend
Messages: 8
Registered: July 2011
Junior Member
Hi Alex,

Thanks for the custom extension suggestion. I'm reading a bit about creating an extension and wanted to look at the RCP/Group example mentioned at this link as that seems most applicable to our use case. My installation of 8.2.0 (and 8.2.1) does not appear to include this example, only the JavaFX/JSlider and Swing/PieChart are found. Can I find the RCP/Group example elsewhere online and download it?

Best Regards,
-Kevin
Re: Cross-platform (Linux-Windows) RCP testing [message #1717941 is a reply to message #1717904] Thu, 17 December 2015 22:21 Go to previous messageGo to next message
Kevin Mills is currently offline Kevin MillsFriend
Messages: 8
Registered: July 2011
Junior Member
Hi Alex,

I was able to get my java/reflection code "work-around" working today so I can use setData("TEST_COMP_NAME",...) on the non-standard dialog buttons that I don't really create or own. We're going to use this work-around for the time being. I think it'll work just fine. I may run into additional cases in the future where this solution will not be applicable and at that point may have to pursue the custom extension. Thanks for you're help and input on this.

-Kevin
Re: Cross-platform (Linux-Windows) RCP testing [message #1718984 is a reply to message #1717941] Mon, 04 January 2016 09:30 Go to previous message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
Hi Kevin,

Thanks for your post - I'm glad you have found a way of realising it for now. Would you be willing to share what you've done here so that others can use it?

Thanks for your efforts!
Alex
Previous Topic:Configuring Jubula for website testing with Firefox and IE11
Next Topic:Jubula - is gray box testing possible?
Goto Forum:
  


Current Time: Sat Feb 24 22:56:37 GMT 2024

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

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

Back to the top