Access value inside Grid of class type "wxWindowNR" using pywinauto

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

Access value inside Grid of class type "wxWindowNR" using pywinauto

Amrutha Pobbati

Is there any way to access values inside a grid table using pywinauto  like cell A2 in above picture

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Access value inside Grid of class type "wxWindowNR" using pywinauto

GadgetSteve


On 21/12/2017 21:58, Amrutha Pobbati wrote:
> <https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flh3.googleusercontent.com%2F-6P-mNbjfZ7I%2FWjwuSOQvTjI%2FAAAAAAAANA4%2FcyYzgfUJ66864jovpXsgsWzTvieP5e1UgCLcBGAs%2Fs1600%2FCapture2.PNG&data=02%7C01%7C%7C9fe7216e2af84edb7e1708d548bdef02%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636494902945565829&sdata=MzzNgAjPeKh0NTqq8Eh3lXDX6fsgWT%2Bzg74xY%2BBiwKc%3D&reserved=0>
>
> Is there any way to access values inside a grid table using pywinauto  
> like cell A2 in above picture
>

I am sure that it is in a couple of ways:

  1. Use the print_control_identifiers() to try to identify it
  2. Add to your code, (possibly only in test mode), a menu item "Get
Cell Value" that produces a dialogue prompting for the Cell ID and then
a result dialogue with the fetched value and an OK button - you can then
use the menu to produce the first dialogue, type text to enter A2 and
read the contents of the results dialogue.
  3. Use the uia_controls ListViewWrapper to select A2, (I would expect
as cell(1, 0) since it is (row, col) indexes), see
http://pywinauto.readthedocs.io/en/latest/code/pywinauto.controls.uia_controls.html?highlight=grid#pywinauto.controls.uia_controls.ListViewWrapper
  4. Double Click (Mouse.DoubleClick) on its coordinates and then use
Selected Text
(http://pywinauto.readthedocs.io/en/latest/code/pywinauto.controls.uia_controls.html?highlight=grid#pywinauto.controls.uia_controls.ListViewWrapper)
- this is a little fragile as it relies on absolute positioning so a
font change could, potentially, break your tests.

--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.

---
This email has been checked for viruses by AVG.
http://www.avg.com

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Access value inside Grid of class type "wxWindowNR" using pywinauto

Amrutha Pobbati
In reply to this post by Amrutha Pobbati
When I use print_control_identifiers, it gives the class name of grid as "wxWindowNR" and I am only able to do some basic stuff like drawing outline and Setting focus on A1 cell. Unable to move forward, any way to move focus to its next cell

On Thursday, December 21, 2017 at 4:58:05 PM UTC-5, Amrutha Pobbati wrote:

<a href="https://lh3.googleusercontent.com/-6P-mNbjfZ7I/WjwuSOQvTjI/AAAAAAAANA4/cyYzgfUJ66864jovpXsgsWzTvieP5e1UgCLcBGAs/s1600/Capture2.PNG" style="margin-left:1em;margin-right:1em" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://lh3.googleusercontent.com/-6P-mNbjfZ7I/WjwuSOQvTjI/AAAAAAAANA4/cyYzgfUJ66864jovpXsgsWzTvieP5e1UgCLcBGAs/s1600/Capture2.PNG&#39;;return true;" onclick="this.href=&#39;https://lh3.googleusercontent.com/-6P-mNbjfZ7I/WjwuSOQvTjI/AAAAAAAANA4/cyYzgfUJ66864jovpXsgsWzTvieP5e1UgCLcBGAs/s1600/Capture2.PNG&#39;;return true;">

Is there any way to access values inside a grid table using pywinauto  like cell A2 in above picture

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Access value inside Grid of class type "wxWindowNR" using pywinauto

Amrutha Pobbati
In reply to this post by GadgetSteve
When I use print_control_identifiers, it gives the class name of grid as "wxWindowNR" and I am only able to do some basic stuff like drawing outline and Setting focus on A1 cell. Unable to move forward, any way to move focus to its next cell


On Friday, December 22, 2017 at 12:46:24 AM UTC-5, Gadget Steve wrote:


On 21/12/2017 21:58, Amrutha Pobbati wrote:
> <<a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flh3.googleusercontent.com%2F-6P-mNbjfZ7I%2FWjwuSOQvTjI%2FAAAAAAAANA4%2FcyYzgfUJ66864jovpXsgsWzTvieP5e1UgCLcBGAs%2Fs1600%2FCapture2.PNG&amp;data=02%7C01%7C%7C9fe7216e2af84edb7e1708d548bdef02%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636494902945565829&amp;sdata=MzzNgAjPeKh0NTqq8Eh3lXDX6fsgWT%2Bzg74xY%2BBiwKc%3D&amp;reserved=0" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Feur02.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Flh3.googleusercontent.com%252F-6P-mNbjfZ7I%252FWjwuSOQvTjI%252FAAAAAAAANA4%252FcyYzgfUJ66864jovpXsgsWzTvieP5e1UgCLcBGAs%252Fs1600%252FCapture2.PNG%26data%3D02%257C01%257C%257C9fe7216e2af84edb7e1708d548bdef02%257C84df9e7fe9f640afb435aaaaaaaaaaaa%257C1%257C0%257C636494902945565829%26sdata%3DMzzNgAjPeKh0NTqq8Eh3lXDX6fsgWT%252Bzg74xY%252BBiwKc%253D%26reserved%3D0\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0vmwL1pN2AP6NL6MAIq6Bi83_4g&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Feur02.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Flh3.googleusercontent.com%252F-6P-mNbjfZ7I%252FWjwuSOQvTjI%252FAAAAAAAANA4%252FcyYzgfUJ66864jovpXsgsWzTvieP5e1UgCLcBGAs%252Fs1600%252FCapture2.PNG%26data%3D02%257C01%257C%257C9fe7216e2af84edb7e1708d548bdef02%257C84df9e7fe9f640afb435aaaaaaaaaaaa%257C1%257C0%257C636494902945565829%26sdata%3DMzzNgAjPeKh0NTqq8Eh3lXDX6fsgWT%252Bzg74xY%252BBiwKc%253D%26reserved%3D0\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0vmwL1pN2AP6NL6MAIq6Bi83_4g&#39;;return true;">https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flh3.googleusercontent.com%2F-6P-mNbjfZ7I%2FWjwuSOQvTjI%2FAAAAAAAANA4%2FcyYzgfUJ66864jovpXsgsWzTvieP5e1UgCLcBGAs%2Fs1600%2FCapture2.PNG&data=02%7C01%7C%7C9fe7216e2af84edb7e1708d548bdef02%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636494902945565829&sdata=MzzNgAjPeKh0NTqq8Eh3lXDX6fsgWT%2Bzg74xY%2BBiwKc%3D&reserved=0>
>
> Is there any way to access values inside a grid table using pywinauto  
> like cell A2 in above picture
>

I am sure that it is in a couple of ways:

  1. Use the print_control_identifiers() to try to identify it
  2. Add to your code, (possibly only in test mode), a menu item "Get
Cell Value" that produces a dialogue prompting for the Cell ID and then
a result dialogue with the fetched value and an OK button - you can then
use the menu to produce the first dialogue, type text to enter A2 and
read the contents of the results dialogue.
  3. Use the uia_controls ListViewWrapper to select A2, (I would expect
as cell(1, 0) since it is (row, col) indexes), see
<a href="http://pywinauto.readthedocs.io/en/latest/code/pywinauto.controls.uia_controls.html?highlight=grid#pywinauto.controls.uia_controls.ListViewWrapper" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpywinauto.readthedocs.io%2Fen%2Flatest%2Fcode%2Fpywinauto.controls.uia_controls.html%3Fhighlight%3Dgrid%23pywinauto.controls.uia_controls.ListViewWrapper\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNELL6CpT0VavsVhAQUHUIEmpv4_Fg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpywinauto.readthedocs.io%2Fen%2Flatest%2Fcode%2Fpywinauto.controls.uia_controls.html%3Fhighlight%3Dgrid%23pywinauto.controls.uia_controls.ListViewWrapper\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNELL6CpT0VavsVhAQUHUIEmpv4_Fg&#39;;return true;">http://pywinauto.readthedocs.io/en/latest/code/pywinauto.controls.uia_controls.html?highlight=grid#pywinauto.controls.uia_controls.ListViewWrapper
  4. Double Click (Mouse.DoubleClick) on its coordinates and then use
Selected Text
(<a href="http://pywinauto.readthedocs.io/en/latest/code/pywinauto.controls.uia_controls.html?highlight=grid#pywinauto.controls.uia_controls.ListViewWrapper" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpywinauto.readthedocs.io%2Fen%2Flatest%2Fcode%2Fpywinauto.controls.uia_controls.html%3Fhighlight%3Dgrid%23pywinauto.controls.uia_controls.ListViewWrapper\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNELL6CpT0VavsVhAQUHUIEmpv4_Fg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpywinauto.readthedocs.io%2Fen%2Flatest%2Fcode%2Fpywinauto.controls.uia_controls.html%3Fhighlight%3Dgrid%23pywinauto.controls.uia_controls.ListViewWrapper\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNELL6CpT0VavsVhAQUHUIEmpv4_Fg&#39;;return true;">http://pywinauto.readthedocs.io/en/latest/code/pywinauto.controls.uia_controls.html?highlight=grid#pywinauto.controls.uia_controls.ListViewWrapper)
- this is a little fragile as it relies on absolute positioning so a
font change could, potentially, break your tests.

--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.

---
This email has been checked for viruses by AVG.
<a href="http://www.avg.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.avg.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHPVsPPPUdri1u74y4soGOX1W5g_g&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.avg.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHPVsPPPUdri1u74y4soGOX1W5g_g&#39;;return true;">http://www.avg.com

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Access value inside Grid of class type "wxWindowNR" using pywinauto

Tim Roberts
Amrutha Pobbati wrote:
>
> When I use print_control_identifiers, it gives the class name of grid
> as "wxWindowNR" and I am only able to do some basic stuff like drawing
> outline and Setting focus on A1 cell. Unable to move forward, any way
> to move focus to its next cell

Not directly, of course.  That requires modifying the state within the
other application.  All you can do is simulate the human: send
right-arrow keystrokes, or whatever key causes the focus to change.

--
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.