Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyqt5 App select TabItem causes exception (ValueError: NULL COM pointer access) after few seconds #1386

Open
shaoerkuai opened this issue Mar 28, 2024 · 2 comments

Comments

@shaoerkuai
Copy link

shaoerkuai commented Mar 28, 2024

Expected Behavior

The tab be selected

Actual Behavior

COM Null Pointer Error occured

NULL COM pointer access
ValueError: NULL COM pointer access

During handling of the above exception, another exception occurred:

  File "D:\autoscript\src\testClass.py", line 117, in check_window_switch_to_batch_tab
    v.select(1)
  File "D:\autoScript\src\main.py", line 40, in <module>
    z.check_window_switch_to_batch_tab()
pywinauto.uia_defines.NoPatternInterfaceError: 

Steps to Reproduce the Problem

Here is the printed id tree:

   |    |    |    |    | child_window(title="批量检测", control_type="Tab")  # The Tab container
   |    |    |    |    |    | child_window(title="单台检测", control_type="TabItem") # Item 1
   |    |    |    |    |    | child_window(title="批量检测", control_type="TabItem") # Item 2

Short Example of Code to Demonstrate the Problem

        v = self._check_window.child_window(title="批量检测",control_type="Tab")  # This is the tab
        v.select(1) # Select the second tab

If I just print v.texts() and it will print ['单台检测','批量检测'] it seems that be OK.

Specifications

  • Pywinauto version: 0.6.8
  • Python version and bitness: 3.8.6
  • Platform and OS: Windows 10
@shaoerkuai
Copy link
Author

Using click_input() works, but I would run some tests at the same time, not a well solution, any opinions?

@shaoerkuai
Copy link
Author

shaoerkuai commented Mar 28, 2024

I found using inspect.exe action menu Invoke.invoke also works.

Using child_window(...).invoke() to emulate a 'click' rather than click_input () works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant