FAQ

[IronPython] UI Automation: Wrong values for ControlType, AutomationElementID and more. IronPython 2.6.1

Stanger, Wolfram
Jun 16, 2010 at 8:32 am
Hello to all,

over many years I have forced to implement a test automation scenerie in
our company.
Now they will do it and - who hat thougth that - I've got the job! And I
had to bring the job to success!

My Environment:
------------------------
I've succesfully presented a test automation solution only build from
Internet-Software. It includes:

Keyword-Driven Tables in HTML (done with Winword)
!
Python 2.6
!
Robot-Framework
! !
ApplTestlib.py SeleniumLibrary
! !
pyWinAuto WEB-AppToTest
!
WIN32-AppToTest

Later we will embed the solution in a QAtrac process.

Now it's time to test automate GUIs build from Windows-Forms and WPF
too.

First I switched Python 2.6 to IronPython 2.6[and 2.6.1 RC1] and got
only one, but 'very magic', bug in Robot-Framework when creating the
HTML-Report-File.
Second I'm switched the pyWinAuto-Layer to Miscrosoft UI Automation
(.NET >= 3.0) to support all GUI-Frameworks (WIN32, WINFORMS and WPF)

I. In IronPython all UI Automation values ControlTypePropertys (w/o the
window itself) where Type 'panel'. Other values are also not the same
as you can see
with UISpy or UIA Verify (Tool from Codeplex 'white'-Project). The
AutomationIDs has the values from NativeWindowHandles (unique - but
never the same from run to run!).
Only the NamePropertys are OK but often empty (when control has no text
content yet).

II. All Controls in the window title (titlebar, menubar, menuitems, and
min-, max- and close-Button) where completely hidden in Automation-Tree
(I've tested with Raw-, Control- and ContentViews)! These eight controls
are from IronPython-UI Automation not reachable. This may be a
consequence from point I. above.

In this situation it's unpossible for me to identify Controls in the
application to automate!

I have found, I run in exactly the same problems witch where reported
from Jozef in November 2009:
http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November
/011583.html

and heself stated a own solution in
http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November
/011630.html

The solution reads:

'Thanks for your response.
Solution to my problem is to first instantiate AutomationElement from
dll, not from IronPython.
Then all subsequent AutomationElement retrieved from IronPython looks
ok.'

About 30 years I have programmed in ANSI-C (Same SW on Windows,VMS,
Linux, etc.) but now being a newbie to C#, .NET and Python.

Therefore I should have an (syntax-)example for the expression:
'to first instantiate AutomationElement from dll'

Witch DLL (Own written, .NET-DLL. ??)
How to instantiate in C#?
How to transport the AutomationElement to IronPython?

The best will be if jozef.a... will give me some example lines of code
from his solution in nov 2009 in C# and/or Python. Thanks.

Greetings
Wolfram
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100616/214d0930/attachment.html>
reply

Search Discussions

4 responses

  • Yngipy hernan at Jun 17, 2010 at 1:25 am
    I have been playing around UI Automation and IronPython for several days
    now. My impression is that they don't play each other well. Or maybe I
    missed something.

    I am trying to dig deeper to understand why.....

    Probably this issue is not fixed yet?
    http://blogs.msdn.com/b/shrib/archive/2008/03/24/ironpython-cannot-call-automationelement-fromhandle.aspx

    On Wed, Jun 16, 2010 at 3:32 AM, Stanger, Wolfram wrote:

    Hello to all,

    over many years I have forced to implement a test automation scenerie in
    our company.
    Now they will do it and - who hat thougth that - I've got the job! And I
    had to bring the job to success!

    My Environment:
    ------------------------
    I've succesfully presented a test automation solution only build from Internet-Software.
    It includes:

    Keyword-Driven Tables in HTML (done with Winword)
    !
    Python 2.6
    !
    Robot-Framework
    ! !
    ApplTestlib.py SeleniumLibrary
    ! !
    pyWinAuto WEB-AppToTest
    !
    WIN32-AppToTest

    Later we will embed the solution in a QAtrac process.

    Now it's time to test automate GUIs build from Windows-Forms and WPF too.

    First I switched Python 2.6 to IronPython 2.6[and 2.6.1 RC1] and got only
    one, but 'very magic', bug in Robot-Framework when creating the
    HTML-Report-File.
    Second I'm switched the pyWinAuto-Layer to Miscrosoft UI Automation (.NET
    = 3.0) to support all GUI-Frameworks (WIN32, WINFORMS and WPF)
    I. In IronPython all UI Automation values ControlTypePropertys (w/o the
    window itself) where Type 'panel'. Other values are also not the same as
    you can see
    with UISpy or UIA Verify (Tool from Codeplex 'white'-Project). The
    AutomationIDs has the values from NativeWindowHandles (unique - but never
    the same from run to run!).
    Only the NamePropertys are OK but often empty (when control has no text
    content yet).

    II. All Controls in the window title (titlebar, menubar, menuitems, and
    min-, max- and close-Button) where completely hidden in Automation-Tree
    (I've tested with Raw-, Control- and ContentViews)! These eight controls are
    from IronPython-UI Automation not reachable. This may be a consequence from
    point I. above.

    In this situation it's unpossible for me to identify Controls in the
    application to automate!

    I have found, I run in exactly the same problems witch where reported
    from Jozef in November 2009:

    http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November/011583.html

    and heself stated a own solution in

    http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November/011630.html

    The solution reads:

    'Thanks for your response.
    Solution to my problem is to first instantiate AutomationElement from dll,
    not from IronPython.
    Then all subsequent AutomationElement retrieved from IronPython looks ok.'

    About 30 years I have programmed in ANSI-C (Same SW on Windows,VMS, Linux,
    etc.) but now being a newbie to C#, .NET and Python.

    Therefore I should have an (syntax-)example for the expression:
    'to first instantiate AutomationElement from dll'

    Witch DLL (Own written, .NET-DLL. ??)
    How to instantiate in C#?
    How to transport the AutomationElement to IronPython?

    The best will be if jozef.a... will give me some example lines of code from
    his solution in nov 2009 in C# and/or Python. Thanks.

    Greetings
    Wolfram

    _______________________________________________
    Users mailing list
    Users at lists.ironpython.com
    http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100616/5cd012a2/attachment.html>
  • Lukas Cenovsky at Jun 18, 2010 at 9:08 am
    Just an idea - create a proxy in C# that calls
    TreeWalker.ControlViewWalker.GetFirstChild and other methods for you and
    return you the results. Maybe it will work. The similar way I created
    the C# proxy to access Win32API functions
    (http://gui-at.blogspot.com/2008/07/simulate-users-input.html)

    --
    -- Luk?s(


    yngipy hernan wrote:
    I have been playing around UI Automation and IronPython for several
    days now. My impression is that they don't play each other well. Or
    maybe I missed something.

    I am trying to dig deeper to understand why.....

    Probably this issue is not fixed
    yet? http://blogs.msdn.com/b/shrib/archive/2008/03/24/ironpython-cannot-call-automationelement-fromhandle.aspx


    On Wed, Jun 16, 2010 at 3:32 AM, Stanger, Wolfram
    <Wolfram.Stanger at kratzer-automation.com
    wrote:

    Hello to all,

    over many years I have forced to implement a test automation
    scenerie in our company.
    Now they will do it and - who hat thougth that - I've got the job!
    And I had to bring the job to success!

    My Environment:
    ------------------------
    I've succesfully presented a test automation solution only build
    from Internet-Software. It includes:

    Keyword-Driven Tables in HTML (done with Winword)
    !
    Python 2.6
    !
    Robot-Framework
    ! !
    ApplTestlib.py SeleniumLibrary
    ! !
    pyWinAuto WEB-AppToTest
    !
    WIN32-AppToTest

    Later we will embed the solution in a QAtrac process.

    Now it's time to test automate GUIs build from Windows-Forms and
    WPF too.

    First I switched Python 2.6 to IronPython 2.6[and 2.6.1 RC1] and
    got only one, but 'very magic', bug in Robot-Framework when
    creating the HTML-Report-File.
    Second I'm switched the pyWinAuto-Layer to Miscrosoft UI
    Automation (.NET >= 3.0) to support all GUI-Frameworks (WIN32,
    WINFORMS and WPF)

    I. In IronPython all UI Automation values ControlTypePropertys
    (w/o the window itself) where Type 'panel'. Other values are also
    not the same as you can see
    with UISpy or UIA Verify (Tool from Codeplex 'white'-Project). The
    AutomationIDs has the values from NativeWindowHandles (unique
    - but never the same from run to run!).
    Only the NamePropertys are OK but often empty (when control has no
    text content yet).

    II. All Controls in the window title (titlebar, menubar,
    menuitems, and min-, max- and close-Button) where completely
    hidden in Automation-Tree (I've tested with Raw-, Control- and
    ContentViews)! These eight controls are from IronPython-UI
    Automation not reachable. This may be a consequence from point I.
    above.

    In this situation it's unpossible for me to identify Controls in
    the application to automate!

    I have found, I run in exactly the same problems witch where
    reported from Jozef in November 2009:
    http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November/011583.html

    and heself stated a own solution in
    http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November/011630.html

    The solution reads:

    'Thanks for your response.
    Solution to my problem is to first instantiate AutomationElement
    from dll, not from IronPython.
    Then all subsequent AutomationElement retrieved from IronPython
    looks ok.'

    About 30 years I have programmed in ANSI-C (Same SW on
    Windows,VMS, Linux, etc.) but now being a newbie to C#, .NET and
    Python.

    Therefore I should have an (syntax-)example for the expression:
    'to first instantiate AutomationElement from dll'

    Witch DLL (Own written, .NET-DLL. ??)
    How to instantiate in C#?
    How to transport the AutomationElement to IronPython?

    The best will be if jozef.a... will give me some example lines of
    code from his solution in nov 2009 in C# and/or Python. Thanks.

    Greetings
    Wolfram

    _______________________________________________
    Users mailing list
    Users at lists.ironpython.com <mailto:Users at lists.ironpython.com>
    http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


    ------------------------------------------------------------------------

    _______________________________________________
    Users mailing list
    Users at lists.ironpython.com
    http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100618/5771350a/attachment.html>
  • Yngipy hernan at Jun 19, 2010 at 4:50 am
    This is what I am doing currently. But I wished I can do all the fun in
    IronPython without using C#.
    On Fri, Jun 18, 2010 at 4:08 AM, Lukas Cenovsky wrote:

    Just an idea - create a proxy in C# that calls
    TreeWalker.ControlViewWalker.GetFirstChild and other methods for you and
    return you the results. Maybe it will work. The similar way I created the C#
    proxy to access Win32API functions (
    http://gui-at.blogspot.com/2008/07/simulate-users-input.html)

    --
    -- Luk??


    yngipy hernan wrote:

    I have been playing around UI Automation and IronPython for several days
    now. My impression is that they don't play each other well. Or maybe I
    missed something.

    I am trying to dig deeper to understand why.....

    Probably this issue is not fixed yet?
    http://blogs.msdn.com/b/shrib/archive/2008/03/24/ironpython-cannot-call-automationelement-fromhandle.aspx


    On Wed, Jun 16, 2010 at 3:32 AM, Stanger, Wolfram <
    Wolfram.Stanger at kratzer-automation.com> wrote:
    Hello to all,

    over many years I have forced to implement a test automation scenerie in
    our company.
    Now they will do it and - who hat thougth that - I've got the job! And I
    had to bring the job to success!

    My Environment:
    ------------------------
    I've succesfully presented a test automation solution only build from Internet-Software.
    It includes:

    Keyword-Driven Tables in HTML (done with Winword)
    !
    Python 2.6
    !
    Robot-Framework
    ! !
    ApplTestlib.py SeleniumLibrary
    ! !
    pyWinAuto WEB-AppToTest
    !
    WIN32-AppToTest

    Later we will embed the solution in a QAtrac process.

    Now it's time to test automate GUIs build from Windows-Forms and WPF too.

    First I switched Python 2.6 to IronPython 2.6[and 2.6.1 RC1] and got only
    one, but 'very magic', bug in Robot-Framework when creating the
    HTML-Report-File.
    Second I'm switched the pyWinAuto-Layer to Miscrosoft UI Automation (.NET
    = 3.0) to support all GUI-Frameworks (WIN32, WINFORMS and WPF)
    I. In IronPython all UI Automation values ControlTypePropertys (w/o the
    window itself) where Type 'panel'. Other values are also not the same as
    you can see
    with UISpy or UIA Verify (Tool from Codeplex 'white'-Project). The
    AutomationIDs has the values from NativeWindowHandles (unique - but never
    the same from run to run!).
    Only the NamePropertys are OK but often empty (when control has no text
    content yet).

    II. All Controls in the window title (titlebar, menubar, menuitems, and
    min-, max- and close-Button) where completely hidden in Automation-Tree
    (I've tested with Raw-, Control- and ContentViews)! These eight controls are
    from IronPython-UI Automation not reachable. This may be a consequence from
    point I. above.

    In this situation it's unpossible for me to identify Controls in the
    application to automate!

    I have found, I run in exactly the same problems witch where reported
    from Jozef in November 2009:

    http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November/011583.html

    and heself stated a own solution in

    http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November/011630.html

    The solution reads:

    'Thanks for your response.
    Solution to my problem is to first instantiate AutomationElement from dll,
    not from IronPython.
    Then all subsequent AutomationElement retrieved from IronPython looks ok.'

    About 30 years I have programmed in ANSI-C (Same SW on Windows,VMS, Linux,
    etc.) but now being a newbie to C#, .NET and Python.

    Therefore I should have an (syntax-)example for the expression:
    'to first instantiate AutomationElement from dll'

    Witch DLL (Own written, .NET-DLL. ??)
    How to instantiate in C#?
    How to transport the AutomationElement to IronPython?

    The best will be if jozef.a... will give me some example lines of code
    from his solution in nov 2009 in C# and/or Python. Thanks.

    Greetings
    Wolfram

    _______________________________________________
    Users mailing list
    Users at lists.ironpython.com
    http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
    ------------------------------

    _______________________________________________
    Users mailing listUsers at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com



    _______________________________________________
    Users mailing list
    Users at lists.ironpython.com
    http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100618/f005bfa3/attachment.html>
  • Yngipy hernan at Jun 20, 2010 at 4:23 am
    Ok, I have a sample project how to use UI Automation with IronPython, see :
    http://pyas.svn.sourceforge.net/viewvc/pyas/trunk/src/ipr/

    <http://pyas.svn.sourceforge.net/viewvc/pyas/trunk/src/ipr/>Basically, I
    have to :
    Create a really simple DLL using C# that reports the root element. That's
    it.

    Regards,
    Yngipy
    On Fri, Jun 18, 2010 at 11:50 PM, yngipy hernan wrote:

    This is what I am doing currently. But I wished I can do all the fun in
    IronPython without using C#.

    On Fri, Jun 18, 2010 at 4:08 AM, Lukas Cenovsky wrote:

    Just an idea - create a proxy in C# that calls
    TreeWalker.ControlViewWalker.GetFirstChild and other methods for you and
    return you the results. Maybe it will work. The similar way I created the C#
    proxy to access Win32API functions (
    http://gui-at.blogspot.com/2008/07/simulate-users-input.html)

    --
    -- Luk??


    yngipy hernan wrote:

    I have been playing around UI Automation and IronPython for several days
    now. My impression is that they don't play each other well. Or maybe I
    missed something.

    I am trying to dig deeper to understand why.....

    Probably this issue is not fixed yet?
    http://blogs.msdn.com/b/shrib/archive/2008/03/24/ironpython-cannot-call-automationelement-fromhandle.aspx


    On Wed, Jun 16, 2010 at 3:32 AM, Stanger, Wolfram <
    Wolfram.Stanger at kratzer-automation.com> wrote:
    Hello to all,

    over many years I have forced to implement a test automation scenerie in
    our company.
    Now they will do it and - who hat thougth that - I've got the job! And I
    had to bring the job to success!

    My Environment:
    ------------------------
    I've succesfully presented a test automation solution only build from Internet-Software.
    It includes:

    Keyword-Driven Tables in HTML (done with Winword)
    !
    Python 2.6
    !
    Robot-Framework
    ! !
    ApplTestlib.py SeleniumLibrary
    ! !
    pyWinAuto WEB-AppToTest
    !
    WIN32-AppToTest

    Later we will embed the solution in a QAtrac process.

    Now it's time to test automate GUIs build from Windows-Forms and WPF too.

    First I switched Python 2.6 to IronPython 2.6[and 2.6.1 RC1] and got only
    one, but 'very magic', bug in Robot-Framework when creating the
    HTML-Report-File.
    Second I'm switched the pyWinAuto-Layer to Miscrosoft UI Automation (.NET
    = 3.0) to support all GUI-Frameworks (WIN32, WINFORMS and WPF)
    I. In IronPython all UI Automation values ControlTypePropertys (w/o the
    window itself) where Type 'panel'. Other values are also not the same as
    you can see
    with UISpy or UIA Verify (Tool from Codeplex 'white'-Project). The
    AutomationIDs has the values from NativeWindowHandles (unique - but never
    the same from run to run!).
    Only the NamePropertys are OK but often empty (when control has no text
    content yet).

    II. All Controls in the window title (titlebar, menubar, menuitems, and
    min-, max- and close-Button) where completely hidden in Automation-Tree
    (I've tested with Raw-, Control- and ContentViews)! These eight controls are
    from IronPython-UI Automation not reachable. This may be a consequence from
    point I. above.

    In this situation it's unpossible for me to identify Controls in the
    application to automate!

    I have found, I run in exactly the same problems witch where reported
    from Jozef in November 2009:

    http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November/011583.html

    and heself stated a own solution in

    http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November/011630.html

    The solution reads:

    'Thanks for your response.
    Solution to my problem is to first instantiate AutomationElement from
    dll, not from IronPython.
    Then all subsequent AutomationElement retrieved from IronPython looks
    ok.'

    About 30 years I have programmed in ANSI-C (Same SW on Windows,VMS,
    Linux, etc.) but now being a newbie to C#, .NET and Python.

    Therefore I should have an (syntax-)example for the expression:
    'to first instantiate AutomationElement from dll'

    Witch DLL (Own written, .NET-DLL. ??)
    How to instantiate in C#?
    How to transport the AutomationElement to IronPython?

    The best will be if jozef.a... will give me some example lines of code
    from his solution in nov 2009 in C# and/or Python. Thanks.

    Greetings
    Wolfram

    _______________________________________________
    Users mailing list
    Users at lists.ironpython.com
    http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
    ------------------------------

    _______________________________________________
    Users mailing listUsers at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com



    _______________________________________________
    Users mailing list
    Users at lists.ironpython.com
    http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100619/31ccf7fb/attachment.html>

Related Discussions

Discussion Navigation
viewthread | post