[LDTP-Dev] Windows Vistat : getWindownList OK, but guiExist KO.

Nagappan Alagappan nagappan at gmail.com
Mon Oct 22 11:10:37 PDT 2012


Hi Philippe,

You can use guiExist to check just a window as well, if you don't pass any
argument, it will check for the window existence. If you pass any argument,
then its to check for an object inside the window.

Thanks
Nagappan

On Mon, Oct 22, 2012 at 11:01 AM, phlinux <philippe.legay at keynectis.com>wrote:

>
> Hi Nagappan,
>
> By compiling the sources, I can do some debug and my understanding is
> better.
>
>  list = l.getWindowList() ; => Give a list of windows
>  list = certif.getObjectList() ; => give a list of objects for a window
>
> I think I have a full misunderstanding of the guiExist() primitive, because
> now I can see the error :
> Error HRESULT E_FAIL has been returned from a call to a COM component.
>    at
> UIAutomationClient.IUIAutomationElement.GetCurrentPropertyValueEx(Int32
> propertyId, Int32 ignoreDefaultValue)
>    at
>
> System.Windows.Automation.AutomationElement.GetCurrentPropertyValue(AutomationProperty
> property, Boolean ignoreDefaultValue)
>    at
>
> System.Windows.Automation.AutomationElement.GetCurrentPropertyValue(AutomationProperty
> property)
>    at
>
> System.Windows.Automation.AutomationElement.GetPropertyValue(AutomationProperty
> property, Boolean cached)
>    at
>
> System.Windows.Automation.AutomationElement.AutomationElementInformation.get_Name()
>    at Ldtpd.Utils.GetWindowHandle(String windowName, Boolean waitForObj,
> Control Type[] type) in
> C:\Users\no_admin\GIT_LDTP\cobra\Ldtpd\Utils.cs:line
> 443
>
> So "guiExist si to test property, not to check if a windows is on the
> screen".
>
>
>
>
>
> Nagappan wrote:
> >
> > Hi Philippe,
> >
> > I guess the API syntax you are using is incorrect, you have to use this
> > [1], rather than [2].
> >
> > Same applies to waitTillGuiExist. Not sure, why it waits for infinite, as
> > the default wait time is 30 seconds.
> >
> > Thanks
> > Nagappan
> >
> > [1] -
> > http://ldtp.freedesktop.org/javadoc/com/cobra/ldtp/Ldtp.html#guiExist()
> > [2] -
> >
> http://ldtp.freedesktop.org/javadoc/com/cobra/ldtp/Ldtp.html#guiExist(java.lang.String)
> >
> > On Thu, Oct 18, 2012 at 3:55 PM, phlinux
> > <philippe.legay at keynectis.com>wrote:
> >
> >>
> >> Hello,
> >>
> >> I am new with Ldtp, but the tools seems to be very interresting. I am
> >> working on windows (seven) with Java.
> >> I do a getWindowsList() : OK. From this list, I get an window item.
> >> guiExist() will return false for this item,
> >> but getObjectList on this item is OK. The documentation "How to enable
> >> the
> >> accessibility" explains what to do for Gnome, not for Windows.
> >>
> >> In fact, in real life, the list[1] windows will not present at start
> >> time,
> >> but few seconds later. So I need to wait for this windows. But if exist
> >> does
> >> not work, when the windows is here, this will explain why the
> >> waiTilGuiExist does not work.
> >>
> >> I do not understand why list, access are OK, but exist fails.
> >>
> >> Have you ideas, pointers, solutions ?
> >>
> >> Thanks,
> >>
> >> ==== The code ======
> >>
> >>        Ldtp l = new Ldtp("frmWebDriver - Windows Internet Explorer") ;
> >>
> >>        list = l.getWindowList() ;
> >>        for (int i = 0 ; i < list.length ; i ++) {
> >> System.out.println("Windowlist ["+i+"] = "+list[i]) ; }
> >>
> >> === Output ===
> >> Windowlist [0] = frmWebDriver - Windows Internet Explorer
> >> Windowlist [1] = dlgWindows Security
> >> Windowlist [2] = pane
> >> Windowlist [3] = pane0
> >> ....
> >> ==============
> >>
> >>        System.out.println("Exist "+l.guiExist("*"+list[1]+"*")) ;
> >> === Output ===
> >> 0
> >> ===============
> >>
> >>        Ldtp certif = new Ldtp(list[1]) ;
> >>        list = certif.getObjectList() ;
> >>        for (int i = 0 ; i < list.length ; i ++) {
> >> System.out.println("Object ["+i+"] = "+list[i]) ; }
> >>
> >> === Output ===
> >> Object [0] = paneWindowsSecurity
> >> Object [1] = pane1
> >> Object [2] = btnOK
> >> ....
> >> ===============
> >>      l.waitTillGuiExist(list[1]) ;  // Infinite Wait !
> >> --
> >> View this message in context:
> >>
> http://old.nabble.com/Windows-Vistat-%3A-getWindownList-OK%2C-but-guiExist-KO.-tp34575303p34575303.html
> >> Sent from the Free Desktop - LDTP mailing list archive at Nabble.com.
> >>
> >> _______________________________________________
> >> LDTP-dev mailing list
> >> LDTP-dev at lists.freedesktop.org
> >> http://lists.freedesktop.org/mailman/listinfo/ldtp-dev
> >>
> >
> >
> >
> > --
> > Cross platform GUI testing
> > Linux Desktop (GUI Application) Testing Project -
> > http://ldtp.freedesktop.org
> > Cobra - Windows GUI Automation tool - https://github.com/ldtp/cobra
> > ATOMac - Mac GUI Automation tool - https://github.com/pyatom/pyatom
> > http://nagappanal.blogspot.com
> >
> > _______________________________________________
> > LDTP-dev mailing list
> > LDTP-dev at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/ldtp-dev
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/Windows-Vista-%3A-getWindownList-OK%2C-but-guiExist-KO-%28%2B---solved%29-tp34575303p34588199.html
> Sent from the Free Desktop - LDTP mailing list archive at Nabble.com.
>
> _______________________________________________
> LDTP-dev mailing list
> LDTP-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/ldtp-dev
>



-- 
Cross platform GUI testing
Linux Desktop (GUI Application) Testing Project -
http://ldtp.freedesktop.org
Cobra - Windows GUI Automation tool - https://github.com/ldtp/cobra
ATOMac - Mac GUI Automation tool - https://github.com/pyatom/pyatom
http://nagappanal.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/ldtp-dev/attachments/20121022/42a71f99/attachment.html>


More information about the LDTP-dev mailing list