none
Coded UI cannot programmatically expose elements of a panel

    Question

  • What I have is a desktop page which displays a list of buttons.  A click of any of the list buttons open a panel with other elements in it (buttons, text-boxes, combo-boxes, etc.).

    The problem is if I click any of the list buttons programmatically with coded ui , I can NOT access the panel elements with coded UI.

    If I click any of the list buttons manually with the mouse, I can then access any of the panel elements with coded ui without a problem.

    Has anyone run into this problem?  I have tried everything in my power to no avail.  Navigational techniques will not work because there are no tabs for the control that I need to click.  Any ideas???


    NR

    Friday, September 29, 2017 4:19 PM

Answers

  • After more than a day with no answer,  I have found that sometimes it seems as if codedui does a half ass job at clicking a control.  In my case the control click was visually working as expected, it exposed the grid the user is supposed to see, however from a codedui perspective, there was a panel blocking the grid.  In fact this could be a problem with dev express controls not behaving as expected.

    It turns out that if I do a mouse hover over control X which exposes the grid and then do a click on control X, then the grid is correctly identified by codedui.  If I don't do the hover prior to the click, codedui never gets the grid.

    Weird, but this is the only way I've found to resolve the problem. I tend to think that this is likely a devExpress control implementation problem, but I'm not sure. It could be the codedui engine.


    NR

    • Marked as answer by Highlander4 Sunday, February 11, 2018 8:40 PM
    Sunday, February 11, 2018 8:40 PM

All replies

  • Hi NR,

    Thanks for your posting.

    How are the steps that you click the button?

    Normally, if we want to programmatically click the combo-boxes or drop-down lists, we need give action that make them display first.

    So, I'd like to have a look at your testing code if it's possible.

     

    Best regards,

    Fletcher


    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, October 4, 2017 6:30 AM
  • Sorry for late reply.  I had found that re-opening the same page would make the controls visible, but I'm running into a page that is extra problematic and even re-opening the page will not do it.

    Here are the instances in which it fails.

    First Instance:

    In code, if I use Mouse.Click(TabControl)

    and then Mouse.Click(SortButtonControl)   // It fails to find this button in the TabControl page.

    Second Instance:

    in code if I use Mouse.Click(TabControl)  // At this point I stop the acpplication

    then using Coded UI Test Builder to locate SortButtonControl.  It also Fails to locate the control

    Third Instance:

    Manually, if I click TabControl   // after this I run the application 

    and in code I use Mouse.Click(SortButtonControl)  it finds the Sort button all the time and any other control in the page.

    Keep in mind that I have used the WaitUntil ready, enabled, and other tricks to no avail.  It seems as if the programmatic button click doesn't work on these pages. These are mostly devexpress controls which seem to be problematic, however, I don't understand why opening the page manually exposes the controls, but opening it programmatically does not.

    If anyone has encounter this problem and arrived to a fix please let me know.


    NR

    Tuesday, January 2, 2018 5:38 PM
  • This is a problem that may need some expert advise from the developers of codedui. 

    I don't understand what's different from manually accessing a desktop app page and then discovering a grid via codedui, which works fine, as supposed to:   Programmatically accessing the same page via codedui and discovering the same grid which fail.

    It's like codedui doesn't expose the controls the same way as a human standing in front the application clicking a mouse to get to the sought after page.

    I'd like to know if anyone has run into this problem.


    NR

    Friday, February 9, 2018 9:08 PM
  • After more than a day with no answer,  I have found that sometimes it seems as if codedui does a half ass job at clicking a control.  In my case the control click was visually working as expected, it exposed the grid the user is supposed to see, however from a codedui perspective, there was a panel blocking the grid.  In fact this could be a problem with dev express controls not behaving as expected.

    It turns out that if I do a mouse hover over control X which exposes the grid and then do a click on control X, then the grid is correctly identified by codedui.  If I don't do the hover prior to the click, codedui never gets the grid.

    Weird, but this is the only way I've found to resolve the problem. I tend to think that this is likely a devExpress control implementation problem, but I'm not sure. It could be the codedui engine.


    NR

    • Marked as answer by Highlander4 Sunday, February 11, 2018 8:40 PM
    Sunday, February 11, 2018 8:40 PM