I am using codedUI to automate my test cases. And our developers use Kendo UI control by Telerik. I don't have any problem with the recording and playback with controls which have unique names. But we have few controls which are rendered dynamically on the same document and only has name as unique identifier and the html is automatically created and our developers don't have control to modify the name or add id to that html. So the name has GUID automatically added, and this GUID changes most of the times when the test case runs. I tried using controls instead equals operator on the name field but as the GUID is in middle of the name, it is very difficult to use it. For example these are the names of the two controls, "Courses[138a47d6-8313-4df4-b39f-caeffd0aecf2].ExternalCoatingId_input" and "Floors[4fabd16d-4051-4547-bb6d-0847bddc05fbb6d-0847bddc05fe].ExternalCoatingId_input". So now in the search properties if I have to use Name I use contains on Name (i.e. Name. Contains(Courses) or Name. Contains(ExternalCoatingId_input)) which don't serve as unique search criteria. What I actually need is Name or ID like "Courses_ExternalCoatingId_input_GUID". So my developers understood my problem and added IDs in the format I requested, but as they don't have control over automatically generated html, they created a hidden control linked to that actual control with name above and added ID to it. Below is the sample html code for a control of that kind.
" span class="k-widget k-combobox k-header" style="width: 220px;" span class="k-dropdown-wrap k-state-default" unselectable="on" tabindex="-1"> input class="k-input" type="text" autocomplete="off" name="Courses[138a47d6-8313-4df4-b39f-caeffd0aecf2].ExternalCoatingId_input" style="width: 100%;" role="combobox" aria-expanded="false" placeholder="Select External Coating ..." tabindex="0" aria-disabled="false" aria-readonly="false" aria-autocomplete="both" aria-owns="tank-component-external-coating-Course-a490312e-c9f5-494a-8d3f-3ccdc33f7660_listbox" aria-activedescendant="tank-component-external-coating-Course-a490312e-c9f5-494a-8d3f-3ccdc33f7660_option_selected" aria-busy="false">
span class="k-select" unselectable="on" tabindex="-1"> span
input id="tank-component-external-coating-Course-a490312e-c9f5-494a-8d3f-3ccdc33f7660" type="text" style="width: 220px; display: none;" name="Courses[138a47d6-8313-4df4-b39f-caeffd0aecf2].ExternalCoatingId" data-val-number="The field ExternalCoatingId must be a number." data-val="true" data-role="combobox" aria-disabled="false" aria-readonly="false"
span "
But Now when I try to add this ID in UImap.uitest for that control and try to playback the test it is giving error saying "{"Cannot perform 'Click' on the hidden control. Additional Details: \r\nTechnologyName: 'Web'\r\nControlType: 'Edit'\r\nTagName: 'INPUT'\r\nId: 'tank-component-external-coating-Roof-7341237e-a359-4fb9-b9a3-29a282c44480'\r\nName: 'Roofs[4400736d-2a50-40ae-87f2-41acdf200e1f].ExternalCoatingId'\r\n"}" I am using Visual Studio 2012 Premium and Windows 8 OS and IE 10
I apologize for the very elaborate explanation of the problem, but I couldn't find any help in any of the forums which is this specific. I found few forums threads discussing about "cannot click on hidden control" but is totally unrelated to my issue. I appreciate any suggestions on how we can use that hidden control ID and execute my tests case successfully.
Thanks, Raji