Radio Buttons Hidden to VS Test Recorder

4 posts, 0 answers
  1. Matt Walters
    Matt Walters avatar
    2 posts
    Member since:
    Sep 2012

    Posted 22 Dec 2010 Link to this post

    I am currently setting up recorded Coded UI tests in Visual Studio 2010. I am currently having two issues on the play-back of these tests.

    1)    Standard radio buttons are "hidden" prohibiting the testing application from selecting the correct radio button. I think this may have to do with the RadFormDecorator as these are standard .NET Radio Buttons.

    2)    The second issue is a similar scenario in that on play-back of Coded UI tests, the testing app is unable to properly select RadListBoxes that feature a checkbox. I have recreated the test in a different area of my application that is a RadListBox without checkboxes, and it functions properly.


    Any feedback would be greatly appreciated. Thanks!
  2. Bozhidar
    Admin
    Bozhidar avatar
    677 posts

    Posted 28 Dec 2010 Link to this post

    Hi Matt,

    I am afraid I could not reproduce the issues based only on your description. Is it possible to send us a sample page where both issues exist, so we would be able to investigate your scenarios further?

    it will be also useful to send us screenshots of you get from the code and to show what exactly is wrong.

    Greetings,
    Bojo
    the Telerik team
    Explore the entire set of ASP.NET AJAX controls we offer here and browse the myriad online demos to learn more about the components and the features they incorporate.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Matt Walters
    Matt Walters avatar
    2 posts
    Member since:
    Sep 2012

    Posted 04 Jan 2011 Link to this post

    Due to the vast size of the application I am working on I was unsure of a way to accurately send you samples that could be reproducible. However, I was able to create a mock situation for the issue regarding the RadioButtons. To reiterate, the issue I saw with radio buttons was that I was able to successfully record a test (using visual studio) and the recorded steps acknowledged the selection of a radio button, but upon running the test the test player was incapable of "finding" the radio button causing the test to fail. I recreated this scenario as close to my application as possible with a simple two page setup, a "Login" page that contained the radio buttons as well as a Login button, and a confirmation screen that acknowledged a certain radio button was selected and the login button was clicked. I then recorded a test that selected a radio button, and clicked the login button. This test failed when the RadFormDecorator was on the page and passed when this was removed. The only other potential for this to fail that I saw was that the table containing the radio buttons was contained within a fieldset. I removed this fieldset and re-ran the test with the RadFormDecorator both on and off the page. The same results persisted.

    The Telerik components on the page include:
    RadScriptManager
    Telerik AJAX Manager v2010.2.929.35
    RadSkinManager
    RadFormDecorator (toggled for test passing purposes)

    Other Controls:
    Standard radio buttons (contained within standard table)
    Standard button
  5. Bozhidar
    Admin
    Bozhidar avatar
    677 posts

    Posted 05 Jan 2011 Link to this post

    Hello Matt,

    I think that it happens when you are using RadFormDecorator because the control really decorates the elements. How does it work actually, when decorating checkboxes and radiobuttons.

    The non-decorated element will have the following HTML output:

    <input type="radio" value="rbtAnd4" name="rbtGrp4" id="rbtAnd4">

    While when the radiobuttons is decorated, we apply an additional class to the real element with text-indent of -9999px, so the element to be hidden and then we generate an additional HTML element:

    <input type="radio" value="rbtAnd4" name="rbtGrp4" id="rbtAnd4" _rfddecoratedid="_rfdSkinnedrbtAnd4" class="rfdRealInput">
    <label for="rbtAnd4" id="_rfdSkinnedrbtAnd4" class=" rfdRadioUnchecked">Yes</label>

    The label element now has background image with the radio button, the sprite image has states for unchecked button, unchecked hover state, checked, checked hover state, unchecked disabled and checked disabled states. When you click the label, it corresponds with JavaScript with the hidden real radiobutton input and executes some action.

    During your test you should work with the ID of the real input instead of the label ID.

    If you are still experiencing problems could you please send:

    - APSX page you are testing
    - the code of the test you are running
    - the error message when the test fails

    Best wishes,
    Bojo
    the Telerik team
    Explore the entire set of ASP.NET AJAX controls we offer here and browse the myriad online demos to learn more about the components and the features they incorporate.
Back to Top