locked
UI Control Map: How do we add new controls to the UI Control Map, without creating redundant parent objects? RRS feed

  • Question

  • Description:
    I would like to come back at another time and add addition controls to my UI Control Map, without the editor creating redundant parent controls. This does not appear to happen if I add all the controls in one sitting without close the web browser. However, if I close the web browser and then return later to add another control, the editor creates a redundant parent control. How do I avoid this?

    Details:
    1. I created a VS 2012 “Coded UI Test Project”, added a “Coded UI Test Map” named “MSDN_Home_Page.uitest” to the project, and then, using the “Edit With Coded UI Test Builder”, I added the “Home” link control on the “http://msdn.microsoft.com/en-us/” page to my UI Control Map file, and renamed it and its parent controls for readability.

    2. Next, I restarted the “Edit With Coded UI Test Builder” and re-opened the browser, and navigated back to “http://msdn.microsoft.com/en-us/”, and this time I attempted to add the “Library” link control to my UI Control Map. However, instead of the “Library” link control being placed inside the existing “Header” control, the “Library” control is stored inside a new control, which we’ve named “Header2”. (Note: I’ve renamed the control and its parent controls readability)

    3. Why didn’t “Edit With Coded UI Test Builder” put the “Library_link” object under “Header”? The Search properties of both header controls appear to be identical.

    “Header” properties:

    “Header2” properties:



    • Edited by JETFIRE Monday, March 11, 2013 3:41 PM
    Saturday, March 9, 2013 1:24 AM

All replies

  • Hello JETFIRE,

    Thank you for your post.

    Based on your detailed description, I have created a coded UI test project to repro your scenario in VS2012 through dragging the crosshair on the target control and then clicking Copy to add it to UIMap.

    For coded UItestproject1, I get the following result which is expected:

    In addition, I create another codedUItestproject3 to add controls to UIMap through clicking on the target control. I get the following result which is also expected:

    I can’t repro your issue. I did a research and find a blog (How to test deep hierarchy controls using Coded UI Test in WPF?). Even though that blog is especially applied for WPF app, you still can try to check the CodedUITestBuilder.exe.config to see if MaxLevelsForItemContainer key exists. If the key does not exist the default value still is 2 only. I suggest that you try to add the key and set another value such as 3,4 etc to check if there are some differences.

    In addition, since I can get the expected result on my side, I suggest that you can try the same scenario on another machine to check the result.

    Also I doubt that the issue may be related to your VS.

    You could locate to the IDE folder then run these commands to check if it can help:

    C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE

    Devenv.exe /SafeMode: Launches the IDE in safe mode loading minimal windows.

    Devenv.exe /ResetSettings: Restores the IDE's default settings, optionally resets to the specified VSSettings file.

    Devenv.exe /ResetAddin: Removes commands and command UI associated with the specified Add-in.

    Devenv.exe /ResetSkipPkgs: Clears all SkipLoading tags added to VSPackages.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.



    • Edited by Amanda Zhu Tuesday, March 12, 2013 2:15 AM
    • Marked as answer by Amanda Zhu Monday, March 18, 2013 12:44 AM
    • Unmarked as answer by Amanda Zhu Friday, March 29, 2013 2:25 AM
    Tuesday, March 12, 2013 1:55 AM
  • I have the same problem posted here: How to avoid parallel control trees when recording Coded UI Tests

    This behaviour is exactly the same on various PCs...

    Hans-Peter


    • Edited by Hans-Peter Wednesday, March 13, 2013 7:55 AM
    Tuesday, March 12, 2013 1:12 PM
  • Hello,

    Since we haven't heard from you for a long time, I temporarily close this case. I mark useful reply as answer. If you have any concerns, please feel free to reopen it or submit a new question.

    Thanks for your understanding.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, March 18, 2013 12:44 AM
  • Thank you Amanda Zhu,

    My colleagues and I are continuing to have this issue.

    I’m surprised that you were not easily able to reproduce this issue, even after re-opening the web browser. Did you try having multiple browser windows opened, or signing into MSDN first and then adding the menu object? In all these cases I’m seeing redundant “UIUxheaderPane” parent object being created.

    Per your suggestion, I added and set the “MaxLevelsForItemContainer” to the value 10 (shown below). At first I thought this solved my problem, since I was able to add a new menu object under “Header”. However the next time I re-opened the browser and attempted to add a menu object it went under “Header2”.

        <applicationSettings>
            <ArrangingUIControlMap.Properties.Settings>
                <setting name="MaxLevelsForItemContainer" serializeAs="String">
                    <value>10</value>
                </setting>
            </ArrangingUIControlMap.Properties.Settings>
        </applicationSettings>

    Why is Coded UI creating multiple UIUxheaderPane control type Pane objects in my UI Control Map, if the Search Properties for all of them appear identical?

    Does this have more to do with the differences found under the “Filter Properties” than the “Search Properties”?

    Wednesday, March 27, 2013 11:36 PM
  • Hello JETFRE,

    If still no help, I’m afraid that I don’t have other good idea about this issue. Moreover I can’t repro your issue on my computer.  I suggest that you try to submit this feedback to Microsoft Connect feedback portal: http://connect.microsoft.com, Microsoft engineers will evaluate them seriously. After you have submitted the feedback, you can post the link here. It will be beneficial for other members with similar issues. And I will help you to vote it.

    Thanks for your understanding.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, March 29, 2013 2:25 AM
  • I have same issue, but I don't know how to handle it on the designer level. But you can manually move the generated child controls to their proper parents if you open .uitest file in XML editor.
    Thursday, April 11, 2013 2:06 PM
  • Yes, Bogdan, I had the same problem and i started moving newly added controls to the proper place in .uitest file.

    I developed a Utility to change the hierarchy of controls and using it to save my day to day time for this issue.

    http://uimaphierarchyeditor.codeplex.com/

    Thanks


    Brajpal



    Friday, April 12, 2013 6:12 AM