Tips for testing my GUI.

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Tips for testing my GUI.

Umberto Carletti
Hello everyone. I'm trying to make a test suite for my program. My
idea was to make some functions that use wxUIActionSimulator to move
the mouse on some controls, click on them and check if it does what i
expect. I'm finding really hard to get the coordinates to some
controls like a tool on a wxToolBar or an item on a wxTreeListCtrl.

On the wxTreeListCtrl for example i tried to get the wxRect of the
item I want to click on by using GetItemRect() form the
wxDataViewCtrl, but the method it's not implemented on GTK. For this
case I found a workaround using the key simulation: I move the focus
on the item with the arrow keys and expand it by pressing enter.
Now, however i want to click on a tool of a toolbar and it looks to me
there is no way to get the coordinates of the tool.

The whole process is really tricky, even to make the simplest test.
Can someone give me some tips on how to proper test my gui?

Regards
Umberto

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Tips for testing my GUI.

Richard-45
In article <[hidden email]>,
    Umberto Carletti <[hidden email]> writes:

> The whole process is really tricky, even to make the simplest test.
> Can someone give me some tips on how to proper test my gui?

Separate business logic from UI.  Test business logic separately with
unit tests.  Separate business logic from your UI by using the
Mediator pattern.  I show an example of how to do this with C# here:
<https://www.youtube.com/watch?v=srKO52Upuh0#t=9m28s>

The technique is not specific to C#.
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
            The Terminals Wiki <http://terminals-wiki.org>
     The Computer Graphics Museum <http://ComputerGraphicsMuseum.org>
  Legalize Adulthood! (my blog) <http://LegalizeAdulthood.wordpress.com>

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Tips for testing my GUI.

Vadim Zeitlin-4
In reply to this post by Umberto Carletti
On Thu, 18 Oct 2018 11:22:10 +0200 Umberto Carletti wrote:

UC> Hello everyone. I'm trying to make a test suite for my program. My
UC> idea was to make some functions that use wxUIActionSimulator to move
UC> the mouse on some controls, click on them and check if it does what i
UC> expect. I'm finding really hard to get the coordinates to some
UC> controls like a tool on a wxToolBar or an item on a wxTreeListCtrl.

 Unfortunately this is indeed not always simple. When it's too difficult I
sometimes cheat and just directly synthesize the expected event instead. Of
course, it's not ideal, but in practice there are not going to be many bugs
that won't be detected by this kind of test but would by a test using
wxUIActionSimulator.

UC> On the wxTreeListCtrl for example i tried to get the wxRect of the
UC> item I want to click on by using GetItemRect() form the
UC> wxDataViewCtrl, but the method it's not implemented on GTK.

 It looks like it would be simple to implement it using
gtk_tree_view_get_cell_area(), see
https://developer.gnome.org/gtk3/stable/GtkTreeView.html#gtk-tree-view-get-cell-area
If, by chance, you'd like to submit a patch doing it, please do.

UC> Now, however i want to click on a tool of a toolbar and it looks to me
UC> there is no way to get the coordinates of the tool.

 As toolbar items are synonyms for menu commands, I'd suggest checking the
menu commands, which can be done by synthesizing keyboard input, instead.

UC> The whole process is really tricky, even to make the simplest test.
UC> Can someone give me some tips on how to proper test my gui?

 We really need more high-level helpers in wxUIActionSimulator but we just
don't have them yet, sorry...

 Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/

attachment0 (203 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Tips for testing my GUI.

Steve Barnes
In reply to this post by Umberto Carletti


> -----Original Message-----
> From: [hidden email] <[hidden email]> On Behalf
> Of Umberto Carletti
> Sent: 18 October 2018 10:22
> To: [hidden email]
> Subject: Tips for testing my GUI.
>
> Hello everyone. I'm trying to make a test suite for my program. My idea was to
> make some functions that use wxUIActionSimulator to move the mouse on
> some controls, click on them and check if it does what i expect. I'm finding really
> hard to get the coordinates to some controls like a tool on a wxToolBar or an
> item on a wxTreeListCtrl.
>
> On the wxTreeListCtrl for example i tried to get the wxRect of the item I want to
> click on by using GetItemRect() form the wxDataViewCtrl, but the method it's
> not implemented on GTK. For this case I found a workaround using the key
> simulation: I move the focus on the item with the arrow keys and expand it by
> pressing enter.
> Now, however i want to click on a tool of a toolbar and it looks to me there is
> no way to get the coordinates of the tool.
>
> The whole process is really tricky, even to make the simplest test.
> Can someone give me some tips on how to proper test my gui?
>
> Regards
> Umberto
>
> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to [hidden email]
> or visit http://groups.google.com/group/wx-users
[Steve Barnes]
Umberto,

I suggest taking a look at SikuliX (http://sikulix.com/) for testing the GUI as it allows you to select (and click on) elements by visual recognition.

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Tips for testing my GUI.

anil kumar
In my experience, Sikuli is not the right choice. It works on the image comparisons, many times it gives the wrong results in case of different resolution, different OS and their themes. 


On Fri, Oct 19, 2018 at 9:38 AM Steve Barnes <[hidden email]> wrote:


> -----Original Message-----
> From: [hidden email] <[hidden email]> On Behalf
> Of Umberto Carletti
> Sent: 18 October 2018 10:22
> To: [hidden email]
> Subject: Tips for testing my GUI.
>
> Hello everyone. I'm trying to make a test suite for my program. My idea was to
> make some functions that use wxUIActionSimulator to move the mouse on
> some controls, click on them and check if it does what i expect. I'm finding really
> hard to get the coordinates to some controls like a tool on a wxToolBar or an
> item on a wxTreeListCtrl.
>
> On the wxTreeListCtrl for example i tried to get the wxRect of the item I want to
> click on by using GetItemRect() form the wxDataViewCtrl, but the method it's
> not implemented on GTK. For this case I found a workaround using the key
> simulation: I move the focus on the item with the arrow keys and expand it by
> pressing enter.
> Now, however i want to click on a tool of a toolbar and it looks to me there is
> no way to get the coordinates of the tool.
>
> The whole process is really tricky, even to make the simplest test.
> Can someone give me some tips on how to proper test my gui?
>
> Regards
> Umberto
>
> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to [hidden email]
> or visit http://groups.google.com/group/wx-users
[Steve Barnes]
Umberto,

I suggest taking a look at SikuliX (http://sikulix.com/) for testing the GUI as it allows you to select (and click on) elements by visual recognition.

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Tips for testing my GUI.

Frédéric
> In my experience, Sikuli is not the right choice. It works on the image comparisons, many times it gives the wrong results in case of different resolution, different OS and their themes.

do you use something else?

Best,

F

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Tips for testing my GUI.

anil kumar
I achieved the UI automation by the basic Windows and Mac messages handling. 

On Fri, Oct 19, 2018 at 11:37 PM Frédéric <[hidden email]> wrote:
> In my experience, Sikuli is not the right choice. It works on the image comparisons, many times it gives the wrong results in case of different resolution, different OS and their themes.

do you use something else?

Best,

F

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Tips for testing my GUI.

Umberto Carletti
In reply to this post by Vadim Zeitlin-4
>  It looks like it would be simple to implement it using
> gtk_tree_view_get_cell_area(), see
> https://developer.gnome.org/gtk3/stable/GtkTreeView.html#gtk-tree-view-get-cell-area
> If, by chance, you'd like to submit a patch doing it, please do.

I made the pull request #990 using the method you proposed.

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users