Home » Archived » Jubula » Testing viewAction items
| | |
Re: Testing viewAction items [message #696720 is a reply to message #696599] |
Thu, 14 July 2011 17:34 |
Niels K Messages: 17 Registered: July 2011 |
Junior Member |
|
|
Hi Alex,
I did a very short test with a 'normal' eclipse version, not a version with my own plugins, to give a replicable reference to my problem.
I'll try to give very detailed information, maybe there a small stupid mistake I've done.
- I use Eclipse for testers (indigo version) as AUT with Jubula 0.9.0 standalone
- I Created a new test:
- I configured rcp as Toolkit for test specification as well as for AUT toolkit
- I installed the RCP plugin in Eclipse for testers
- I start the AUT via Jubula. The correct ID appers in the 'Running AUTs'-Window, in the AUT (Eclipse for testers) the 'Functional Test Specification'-Perspective is activated
- I create a new Test Case and open it
- I start the observation mode
- I did the following steps:
- Click on the 'New'-Pull-down-button in the upper left
- Select 'project...' -> The "New Project"-Window apperas
- Click 'Cancel' in the Window that appeared
- Click on the Pull-down-button in the Console-Window
(Exactly the button as posted in the picture in Alex' reply above)
- Select '1 Java Stack trace console' -> The view apperas
- I stop the observing Test Case
- I the screenshot I provied with this post, one can see the recorded steps.
- I save the test case, create a new test suite, add the test case to it, save it and start it.
- The "New"-WizardDropDownMenu is select correctly
- The test fails on the Toolbaritem (please see screenshot)
As Alex posted, it shall be possible to do theese steps. So I assume I have I small mistake, an error in reasoning or forgotten a detail of Jubula or what ever.
Any ideas or can anybody replicate this test (fail or not either way)
I'm grateful for any help.
Many thanks!
Niels
|
|
|
Re: Testing viewAction items [message #696958 is a reply to message #696720] |
Fri, 15 July 2011 08:13 |
Alexandra Schladebeck Messages: 1613 Registered: July 2009 |
Senior Member |
|
|
Hi Niels,
Thank you for the extra information.
I had a look at the behaviour using an Eclipse 3.6 build as the AUT and noticed the following:
The object map for the toolbar items (whether they are with drop down menus or not) seems to be dependent on the number of items in the view toolbar. (If you go into the mapping mode and remap the item, you'll see that you get alternately e.g. toolitem_6 or toolitem_3, depending on how many items are visible - and the number of items changes depending on what you select in the view). Our mapping generates a name, but at some point this name is dependent on the order / amount of items in the final container if no other identifiers are available for differentiation.
For dynamically added components such as these, which can only be differentiated by their number, it would be worthwhile adding given names for them in the application. You can use the method setData(String key, String ComponentName) (described in the user manual in chapter 4.2.4) to set unique names for such components. This will mean that the components are found regardless of their order and number.
You can also put an issue into bugzilla for this if you want to, however, I'm not 100% sure what identifiers we could automatically generate for situations such as these.
Hope this helps!
Alex
|
|
| |
Re: Testing viewAction items [message #702372 is a reply to message #696599] |
Tue, 26 July 2011 09:28 |
Niels K Messages: 17 Registered: July 2011 |
Junior Member |
|
|
Hi,
my last post was hasty. The object recognition is not dependend from the "Generate names" flag status. Sorry for the wrong information.
My latest observation is:
I can map a toolbar item in a fresh installation and a test works with this object. When I perform a perspective reset, the window arrangement changes a little. With the object mapper I can assure that the "Technical name" does not change yet the test fails with a "component not found" error.
With some changes in the "Object recognition profile" (Name Weight to 100%) the test performs well again.
This works for toolbar items with static names, but leads to problems with thoose items with dynamically given names .
Therefore I must assure that all my components have static names.
Following your recommondation, I placed a setData-Call in my code for a text field, that has a "dynamic" "Technical Name" (org.eclipse.swt.widgets.Text_1):
Composite content = new Composite(parent, SWT.NULL);
content.setData("TEST_COMP_NAME", TextFilterControl.class.getName());
I expected to find that name as the "Technical Name" in the object properties, but it remains org.eclipse.swt.widgets.Text_1.
Two questions:
1) Is my expectation correct and is there a mistake with the setData-method in my code or does the TEST_COMP_NAME not affect the technical name (in Jubula)?
2) And if so, can I find the test_comp_name in Jubula?
Thanks for your help,
Niels
|
|
|
Re: Testing viewAction items [message #710776 is a reply to message #696599] |
Fri, 05 August 2011 11:53 |
Niels K Messages: 17 Registered: July 2011 |
Junior Member |
|
|
Hi,
I'm still having problems with this situation. Afer experimenting I've got some new insights.
I'll outline the situation:
- My AUT is a eclipse version with my own plugin
- In my AUT, there is a special window, let's call it 'MyWindow'
- 'MyWindow' contains some ToolbarItems, let's say 'MyTBI_1', 'MyTBI_2', 'MyTBI_3'
- I map theese items with the object mapper. It recognizes them with their specific names 'MyTBI_1', 'MyTBI_2', 'MyTBI_3', not with any generic, dynamically generated names. (I addition to that, I have given the test_comp_name property to theese items with the setData method, but cannot see this anywhere, as I reported in my last post).
- I create a test to click on theese items and put this test in a test suite.
- I run the test, while in my AUT the window 'MyWindow' is visible -> The test suite runs successfully.
- Now I perform manually: 'Windwow->Reset perspectiove' ('MyWindow' disapperas) and 'Window->Show View' ('MyWindow' reappers)
- I run the test again -> The test runs successfully again.
- Now I want to do the reset in within the test. I extend the test to do:
- click on the toolbar items
- Reset perspective
- Show View: Mywindow
- Click on the toolbar items
- I run the test suite. The first click on the toolbar items is ok, the second on after the reset fails.
- This behavior repeats when I start the test suite again.
Any idea why this is happening? It seems as there is any mapping made at the start of the test and something changes with the reset perspective command. But when I remap the toolbar items, no property has changed.
---------------------
I addition to this:
- Now I create a test job and put my test suite in it and run it -> It fails on the first click on the toolbar items, with was successful when I started the test suite dirctly, not through a test job. Hä? Now I'm totally confused.
Any suggestions for a workaround?
Thanks for your help,
Niels
|
|
|
Goto Forum:
Current Time: Thu Apr 25 11:49:10 GMT 2024
Powered by FUDForum. Page generated in 0.02822 seconds
|