This is what I am doing currently. But I wished I can do all the fun in IronPython without using C#.<br><br><div class="gmail_quote">On Fri, Jun 18, 2010 at 4:08 AM, Lukas Cenovsky <span dir="ltr"><<a href="mailto:cenovsky@bakalari.cz">cenovsky@bakalari.cz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff" text="#000000">
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 (<a href="http://gui-at.blogspot.com/2008/07/simulate-users-input.html" target="_blank">http://gui-at.blogspot.com/2008/07/simulate-users-input.html</a>)<br><font color="#888888">
<br>
--<br>
-- Lukáš<br>
<br>
<br>
yngipy hernan wrote:
</font><blockquote type="cite"><div><div></div><div class="h5">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.
<div><br>
</div>
<div>I am trying to dig deeper to understand why.....</div>
<div><br>
</div>
<div>Probably this issue is not fixed yet? <a href="http://blogs.msdn.com/b/shrib/archive/2008/03/24/ironpython-cannot-call-automationelement-fromhandle.aspx" target="_blank">http://blogs.msdn.com/b/shrib/archive/2008/03/24/ironpython-cannot-call-automationelement-fromhandle.aspx</a></div>
<div><br>
</div>
<div><br>
<div class="gmail_quote">On Wed, Jun 16, 2010 at 3:32 AM, Stanger,
Wolfram <span dir="ltr"><<a href="mailto:Wolfram.Stanger@kratzer-automation.com" target="_blank">Wolfram.Stanger@kratzer-automation.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
<div>
<div><font face="Arial" size="2"><span>Hello to all,</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>over many years I have
forced to implement a test automation scenerie in our company.</span></font></div>
<div><font face="Arial" size="2"><span>Now they will do it and
- who hat thougth that - I've got the job! And I had to bring the job
to success!</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>My Environment:</span></font></div>
<div><font face="Arial" size="2"><span>------------------------</span></font></div>
<div><font face="Arial" size="2"><span>I've succesfully presented a
test automation solution only build from </span></font><font face="Arial" size="2"><span>Internet-Software. It includes:</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>Keyword-Driven Tables in
HTML (done with Winword)</span></font></div>
<div><font face="Arial" size="2"><span>
!</span></font></div>
<div><font face="Arial" size="2"><span> Python
2.6</span></font></div>
<div><font face="Arial" size="2"><span>
!</span></font></div>
<div><font face="Arial" size="2"><span>
Robot-Framework</span></font></div>
<div><font face="Arial" size="2"><span>
! !</span></font></div>
<div><font face="Arial" size="2"><span> ApplTestlib.py
SeleniumLibrary</span></font></div>
<div><font face="Arial" size="2"><span> !
!</span></font></div>
<div><font face="Arial" size="2"><span>
pyWinAuto WEB-AppToTest</span></font></div>
<div><font face="Arial" size="2"><span> !</span></font></div>
<div><font face="Arial" size="2"><span> WIN32-AppToTest</span></font></div>
<div> </div>
<div><font face="Arial" size="2"><span>Later we will embed the
solution in a QAtrac process.</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>Now it's time to test
automate GUIs build from Windows-Forms and WPF too.</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>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.</span></font></div>
<div><font face="Arial" size="2"><span>Second I'm switched the
pyWinAuto-Layer to Miscrosoft UI Automation (.NET >= 3.0) to support
all GUI-Frameworks (WIN32, WINFORMS and WPF)</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>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</span></font></div>
<div><font face="Arial" size="2"><span>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!).</span></font></div>
<div><font face="Arial" size="2"><span>Only the NamePropertys are
OK but often empty (when control has no text content yet).</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>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.</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>In this situation it's
unpossible for me to identify Controls in the application to automate!</span></font></div>
<div> </div>
<div><font face="Arial" size="2">
<div><font face="Arial" size="2"><span>I have found, </span></font><font face="Arial" size="2"><span>I run in exactly the same problems witch
where reported from Jozef in November 2009:</span></font></div>
<div><font face="Arial" size="2"><span><a href="http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November/011583.html" target="_blank">http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November/011583.html</a></span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>and heself stated a own
solution in</span></font></div>
</font></div>
<div><font face="Arial" size="2">
<div><font face="Arial" size="2"><span><a href="http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November/011630.html" target="_blank">http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November/011630.html</a></span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>The solution reads:</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>'Thanks for your response.</span></font></div>
<div><font face="Arial" size="2"><span>Solution to my problem is to
first instantiate AutomationElement from dll, not from IronPython.</span></font></div>
<div><font face="Arial" size="2"><span>Then all subsequent
AutomationElement retrieved from IronPython looks ok.'</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>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.</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>Therefore I should have an
(syntax-)example for the expression:</span></font></div>
<div><font face="Arial" size="2"><span> 'to first instantiate
AutomationElement from dll'</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>Witch DLL (Own written,
.NET-DLL. ??)</span></font></div>
<div><font face="Arial" size="2"><span>How to instantiate in C#?</span></font></div>
<div><font face="Arial" size="2"><span>How to transport the
AutomationElement to IronPython?</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>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.</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
</font></div>
<div><span><font face="Arial" size="2">Greetings</font></span></div>
<div><span><font face="Arial" size="2">Wolfram</font></span></div>
</div>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div></div><pre><hr size="4" width="90%"><div class="im">
_______________________________________________
Users mailing list
<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a>
</div></pre>
</blockquote>
<br>
</div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br></blockquote></div><br>