locked
Elements in tab control are not detected sometimes RRS feed

  • Question

  • Hello Everyone,

    I am trying to automate a WPF app. This app has multiple modules and each module has multiple tabs that can be docked. But sometimes when I switch tabs, the elements in the tab control do not appear in the UI automation tree. This behavior is random. As you can see in the screen shots, initially I can see the elements in the 'Shipping Schedule' tab. But after I switch between a few tabs and come back to 'Shipping Schedule' again, inspect cannot detect the elements in the tab. When I float and dock the tab again, the elements reappear in the tree sometimes, this doesn't work always. Could anybody possibly help me with this issue?

    https://social.msdn.microsoft.com/Forums/getfile/1600376

    https://social.msdn.microsoft.com/Forums/getfile/1600375


    Wednesday, June 10, 2020 7:20 AM

All replies

  • Hello Maanav Acharya,

    Thanks for posting here.

    When the issue occurs you can close Inspect and start again to see if it helps.

    And try another tool like Accessibility Insights to see if it can reproduce this issue.

    BTW, the screen shots are not available and return "page not found" for me.

    If the issue still exists you may need to find if it can be reproduced on a official application so I can do a further investigation.

    Or maybe you can show a mini, complete and reproducible sample target application so I can try to reproduce it.

    Best regards,

    Rita


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, June 11, 2020 1:20 AM
  • Hello Rita,

    thank you for replying. 

    I m pretty sure its not an issue with inspect tool. Issue still persists when I restart inspect. I have also tried using Accessibility Insights but the result is same.

    The app uses Prism framework and Unity Container.

    Couldn't attach screen shots/links because my account isn't verified. How can I share the screen shots?

    Regards

    Maanav Acharya

    Monday, June 15, 2020 5:47 PM
  • Hello Maanav Acharya,

    You can reply this thread for verifying your account.

    Best regards,

    Rita


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, June 16, 2020 5:47 AM
  • Hello Rita,

    Here are the screen shots. 

    would also like to mention that even my C# code is not able to find elements when they disappear from tree. ( FindFirst()/FindAll() methods return null ). 

    Regards,

    Maanav Acharya

    Wednesday, June 17, 2020 6:05 AM
  • Hello Maanav Acharya,

    Thanks for your snapshots.

    Comparing these two snapshots, it seems in the “Shipping Schedule” pane, text and button controls are found but custom controls are not found. Can we narrow down this issue to custom controls?

    If your application includes any custom controls, you need to implement UI Automation providers for those controls to make them accessible to accessibility client applications. You also need to implement providers for any third party controls that do not include a provider. You implement a provider by implementing UI Automation provider interfaces and control pattern interfaces.

    Best regards,

    Rita


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, June 17, 2020 9:53 AM
  • Hello Rita,

    I understand your point. But initially the children of the custom control were exposed. Sometimes the child elements are there and sometimes they disappear. 

    Regards,

    Maanav Acharya

     



    Thursday, June 18, 2020 5:51 AM
  • Hello Maanav Acharya,

    >>>But initially the children of the custom tab control were exposed. Sometimes the child elements are they and sometimes they disappear. 

    Yes, I understand your point. But I found there is a difference between two snapshots: the first one's "text box" seems focused but the second one's not focused, right? Could you confirm if it is related to this issue not?

    This issue may related to UI Automation Provider implementation. Further step you can do is debugging to see if you can receive the WM_GETOBJECT message and how do you handle this message for the custom control?

    If you can provide a mini, reproducible sample I can do a further investigation.

    Best regards,

    Rita



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, June 19, 2020 7:07 AM
  • Hello Rita,

    As you can see, even when I focus on the text box, the custom control is not detected. This time I tried it on the 'Movements' tab. I have only turned on 'Watch Focus' option in Inspect.

    I have been reading docs I am trying to understand what you say the problem may be. Please do correct me if I am wrong -
    "Further step you can do is debugging to see if you can receive the WM_GETOBJECT message and how do you handle this message for the custom control? " -> the custom control may not have handled the WM_GETOBJECT message properly and hence the IRawElementProviderSimple interface implementation of the custom control in not being sent to the client.

    "If you can provide a mini, reproducible sample I can do a further investigation" -> will work on this. It may take some time.

    Regards,
    Maanav Acharya

    Tuesday, June 23, 2020 10:53 AM
  • Hello Maanav Acharya,

    Thanks for your confirmation.

    A reproducible sample will helpful for troubleshooting. Thanks for your cooperation.

    Best regards,

    Rita


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, June 24, 2020 8:59 AM