Exception while testng menu

View: New views
2 Messages — Rating Filter:   Alert me  

Exception while testng menu

by DianaZverelo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello.
I am new in swing testing. I am trying to test menu in my program, but have some exceptions, that I don't know where they  come from. If I have menu "menu" and menuitem "about" in it. I am running scenario:

<?xml version="1.0" encoding="UTF-8" ?>
<document windowFinder="ROOT_CONTAINER"   windowClass="JFrame">
<scenario name="OPEN_SEARCH">
        <WindowStatus windowFinder="NAME_IS_EQUAL" windowName="frame0" status="ICONIFIED"/>
        <Click componentFinder="A_COUPLE_OF_CLASS_AND_LABEL_IS_EQUAL"  componentClass="JMenu" label="Menu"/>
        <Click componentFinder="NAME_IS_EQUAL" name="about"/>
</scenario>
</document>

Two senario lines are ok, no exceptions. But on third(last) line I get and exception which says "component must be showing on the screen to determine its location
java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location"

And I get the same exception when I run demo test. Maybe you know what is wrong with my program. (I am ubuntu user)

Re: Exception while testng menu

by Nobuhiko YASUNAKA-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I don't test swingunit on ubuntu. If you get same error when testing
the demo, it may be a timing problem.

Try to change TestSetting.properties value.
On X-Window, it takes a bit more time to show a window rather
than on MS Windows, So put some delay.


> Hello.
> I am new in swing testing. I am trying to test menu in my program, but have
> some exceptions, that I don't know where they  come from. If I have menu
> "menu" and menuitem "about" in it. I am running scenario:
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <document windowFinder="ROOT_CONTAINER"   windowClass="JFrame">
> <scenario name="OPEN_SEARCH">
> <WindowStatus windowFinder="NAME_IS_EQUAL" windowName="frame0"
> status="ICONIFIED"/>
> <Click componentFinder="A_COUPLE_OF_CLASS_AND_LABEL_IS_EQUAL"
> componentClass="JMenu" label="Menu"/>
> <Click componentFinder="NAME_IS_EQUAL" name="about"/>
> </scenario>
> </document>
>
> Two senario lines are ok, no exceptions. But on third(last) line I get and
> exception which says "component must be showing on the screen to determine
> its location
> java.awt.IllegalComponentStateException: component must be showing on the
> screen to determine its location"
>
> And I get the same exception when I run demo test. Maybe you know what is
> wrong with my program. (I am ubuntu user)

--
----------------------------------------------------
Nobuhiko YASUNAKA

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

LightInTheBox - Buy quality products at wholesale price