|
|
Re: Win32 - Test Recording and Win32 properties [message #437573 is a reply to message #437367] |
Mon, 07 June 2004 16:58 |
David Martinez Messages: 3 Registered: July 2009 |
Junior Member |
|
|
I agree the handle is unique, but the problem is that is not consistent
between runs. So it makes it a bit hard to get the testing tool to grab a
hold of something.
For example, Visual Basic has a "vbname" property (probably submitted via
setProp) and the form sets that property to the variable name. What I'd like
to see is a way to use setData (maybe with a special "SWT_WIN32_" prefix on
the key name of some sort) to have the widget automatically call setProp for
me. That way I stay cross-platform and get some properties called
"SWT_WIN32_myPropName" that I can use on a native UI testing tool to obtain
the consistency I need.
So my proposal for the future would be to maybe put something in
org.eclipse.swt.widgets.Widget.setData(key,value) such as:
public void setData (String key, Object value) {
checkWidget();
if (key == null) error (SWT.ERROR_NULL_ARGUMENT);
// Win32 specific - set special property names.
if ( key.startsWith("SWT_WIN32_") ) {
// Of course, write a setProp wrapper and call it.
OS.setProp(key, (String)value);
}
//... continue the normal setData...
Then I could just add a method to set the QA test info via setData() for the
stuff that matters on my swt layout code.
Something like this would allow me to keep the same source across my
Linux/MacOS/Win32 builds and at the same time run the test scripts on Win32.
The best of both worlds, with just a bit of extra swt-win32 specific code.
Thanks for the info on the props stuff though. :-)
- David
"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:c9n6j2$5ut$1@eclipse.org...
> The handle of the control is unique. You can use setData() but that won't
> be visible to a native GUI testing tool. Windows has the win32 functions
> GetProc(), SetProp() and RemoveProp() but SWT doesn't use them. A native
> testing tool might know how to look for these.
>
> "David Martinez" <david.martinez@managestar.com> wrote in message
> news:c9ij3r$gro$1@eclipse.org...
> > My swt-based, RCP application is being tested using QuickTest
> Professional.
> > My SWT version dll is 3.0.4.4 (I'm using the M8 codebase).
> >
> > It seems to work, but a problem arises when you try to script for a
window
> > with more than one ListView, treeview, or other such component.
> >
> > Whenever you try to script against a component that has two instances of
> > itself on the screen, there is no way to uniquely identify the two.
> >
> > Is there a way to have the Win32 version of swt set a custom property
that
> > can be queries at the Win32 level (via Spy++ or other such tool),
> hopefully
> > in a "soft" way (not making my project depend on the win32 stuff)? Maybe
> via
> > setData()?
> >
> >
> >
> > Thank you for your attention,
> >
> >
> >
> > - David Martinez
> >
> >
>
>
|
|
|
Re: Win32 - Test Recording and Win32 properties [message #437592 is a reply to message #437573] |
Tue, 08 June 2004 16:12 |
Steve Northover Messages: 1636 Registered: July 2009 |
Senior Member |
|
|
Please enter a bugzilla report for this inlcuding the discussion. Thanks.
"David Martinez" <david.martinez@managestar.com> wrote in message
news:ca26c5$99u$1@eclipse.org...
> I agree the handle is unique, but the problem is that is not consistent
> between runs. So it makes it a bit hard to get the testing tool to grab a
> hold of something.
>
> For example, Visual Basic has a "vbname" property (probably submitted via
> setProp) and the form sets that property to the variable name. What I'd
like
> to see is a way to use setData (maybe with a special "SWT_WIN32_" prefix
on
> the key name of some sort) to have the widget automatically call setProp
for
> me. That way I stay cross-platform and get some properties called
> "SWT_WIN32_myPropName" that I can use on a native UI testing tool to
obtain
> the consistency I need.
>
> So my proposal for the future would be to maybe put something in
> org.eclipse.swt.widgets.Widget.setData(key,value) such as:
>
> public void setData (String key, Object value) {
> checkWidget();
> if (key == null) error (SWT.ERROR_NULL_ARGUMENT);
>
> // Win32 specific - set special property names.
> if ( key.startsWith("SWT_WIN32_") ) {
> // Of course, write a setProp wrapper and call it.
> OS.setProp(key, (String)value);
> }
> //... continue the normal setData...
>
> Then I could just add a method to set the QA test info via setData() for
the
> stuff that matters on my swt layout code.
>
> Something like this would allow me to keep the same source across my
> Linux/MacOS/Win32 builds and at the same time run the test scripts on
Win32.
> The best of both worlds, with just a bit of extra swt-win32 specific code.
>
> Thanks for the info on the props stuff though. :-)
>
>
> - David
>
>
> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
> news:c9n6j2$5ut$1@eclipse.org...
> > The handle of the control is unique. You can use setData() but that
won't
> > be visible to a native GUI testing tool. Windows has the win32
functions
> > GetProc(), SetProp() and RemoveProp() but SWT doesn't use them. A
native
> > testing tool might know how to look for these.
> >
> > "David Martinez" <david.martinez@managestar.com> wrote in message
> > news:c9ij3r$gro$1@eclipse.org...
> > > My swt-based, RCP application is being tested using QuickTest
> > Professional.
> > > My SWT version dll is 3.0.4.4 (I'm using the M8 codebase).
> > >
> > > It seems to work, but a problem arises when you try to script for a
> window
> > > with more than one ListView, treeview, or other such component.
> > >
> > > Whenever you try to script against a component that has two instances
of
> > > itself on the screen, there is no way to uniquely identify the two.
> > >
> > > Is there a way to have the Win32 version of swt set a custom property
> that
> > > can be queries at the Win32 level (via Spy++ or other such tool),
> > hopefully
> > > in a "soft" way (not making my project depend on the win32 stuff)?
Maybe
> > via
> > > setData()?
> > >
> > >
> > >
> > > Thank you for your attention,
> > >
> > >
> > >
> > > - David Martinez
> > >
> > >
> >
> >
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03477 seconds