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
(pywinauto.controls.uia_controls — pywinauto 0.6.8 documentation)
- this is a little fragile as it relies on absolute positioning so a
font change could, potentially, break your tests.
···
On 21/12/2017 21:58, Amrutha Pobbati wrote:
Is there any way to access values inside a grid table using pywinauto
like cell A2 in above picture
--
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.
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:
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:
Use the print_control_identifiers() to try to identify it
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.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.ListViewWrapperDouble 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) BarnesAny 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.
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, timr@probo.com
Providenza & Boekelheide, Inc.