locked
Microsoft.VisualStudio.TestTools.UITest.Extension.PlaybackFailureException: Cannot perform 'SetProperty of SelectedItemsAsString with value "Jeffrey. miller"' on the control. Additional Details: RRS feed

  • Question

  • I am receiving an above error and I am not sure how to fix this error.  I am fresher in automation learning visual studio.  I am receiving a below error not sure how to solve this.  I tried recording and play back I am still not working.  please see below error

    Test method LSAS_login_controls.CodedUITest1.CodedUITestMethod1 threw exception:
    Microsoft.VisualStudio.TestTools.UITest.Extension.PlaybackFailureException: Cannot perform 'SetProperty of SelectedItemsAsString with value "Jeffrey. miller"' on the control. Additional Details:
    TechnologyName:  'Web'
    ControlType:  'List'
    Id:  'SelectedEAuthID'
    Name:  'SelectedEAuthID'
    TagName:  'SELECT'
     Failed to find any control that matched the search condition DisplayText='Jeffrey. miller' ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0xF004F008

    here are my coding steps.  I have created shared objects and then below is my scripts

               

               

    BrowserWindow.CurrentBrowser = "ie";

               

    BrowserWindowbr = BrowserWindow.Launch("");

               

    // step 2:  object for shared control class


               

    LSASControlslc = newLSASControls(br);

               

    // step 3:  writing the scripts


               

    Mouse.Click(lc.Loginlink);

                lc.SelectUserlists.SelectedItemsAsString = SelectUser;

               

    Mouse.Click(lc.Loginbtn);

                lc.Profilelists.SelectedItemsAsString = Profile;

               

    Mouse.Click(lc.Submitbtn);

               

    Mouse.Click(lc.Confirmbtn);

               

               

    if(isvalidcredentials == "Y")

                {

                   

    stringexpectedRolecombobox = Expectedmessage;

                   

    stringActualRolecombobox = lc.Rolecombobox.InnerText;

                   

    Assert.AreEqual(expectedRolecombobox, ActualRolecombobox);

                }

               

    else


                {

                   

    stringexpectedErrorMessage = Expectedmessage;

                   

    stringActualErrorMessage = lc.ErrormessageSpan.InnerText;

                   

    Assert.AreEqual(expectedErrorMessage, ActualErrorMessage);

                }

               

            }

               

    Please help.  I have looked into my code and have also check object by spying there is no error over there.  This was working before suddenly has stopped working

               


               

               


               

              

               

               

               

          


               

                   

                   

                   

               

     

     


    Wednesday, May 28, 2014 8:22 PM

Answers

  • sheetal,

    It appears your problem is that your SelectUserlists control does not contain a child control that can be set with the string "Jeffrey. miller".

    If SelectUserLists is a combobox, I would expand the control and spy on its items. You will probably find that the string "Jeffrey. miller" does not correspond exactly to any of the child control's DisplayText properties.

    Best,


    Saturday, May 31, 2014 11:44 AM

All replies

  • Hi sheetal,

    Thank you for posting in the MSDN forum.

    Failed to find any control that matched the search condition DisplayText='Jeffrey. miller' ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0xF004F008

    It seems that you don’t use the Coded UI test builder to record a coded UI test, I mean that you handle-code a coded UI test, am I right?

    Based on the error message, it means that it could find the specific control with the search condition. As you said that it worked well before, if so, do you change anything in your side? Maybe the App UI has been changed by the developing team members.

    To narrow down this issue, we need to know how the coded UI test find a control here:

    http://blogs.msdn.com/b/balagans/archive/2009/12/28/9941582.aspx

    So when you hand-coding a coded UI test, you would make sure that you use the unique properties as the search properties, in addition, if the properties are dynamic, it would impact the test result.

    My suggestion is that you could use the Coded UI test builder to record a new test, and then generate it to code, and then test the result. If it works well, you could compare it with your previous test code. Maybe you could find useful information.

    In addition, if you want to verify a UI control in your test, maybe you could use the Add Assertions dialog box in coded UI test builder.

    Reference:

    http://msdn.microsoft.com/en-us/library/dd286671(v=vs.100).aspx

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, May 29, 2014 9:42 AM
  • i did two ways one with hand coding and one with recording.  I did both in coded UI test builder.  while recording I got below error

    "the following element is no longer available :  IE control;ProcessID[5796] window handle[131944]. i tried on brand new coded ui test builder i am receiving same error.  Still not sure how to solve this.

    sheetal

    Thursday, May 29, 2014 1:46 PM
  • Hi sheetal,

    Does it work well before? Which VS version are you using?

    >>"the following element is no longer available..."

    If you use the VS2010 or VS2012, please check whether it is related to this KB2870699.

    Reference:

    http://blogs.msdn.com/b/visualstudioalm/archive/2013/09/17/coded-ui-mtm-issues-on-internet-explorer-with-kb2870699.aspx?PageIndex=3

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, May 30, 2014 7:24 AM
  • I dont have the updates with this number i have checked KB2870699. i am using VS 2010.  I am having real tuff time for finiding actual cause.  I am getting similar error even when I try to record google.com. 

    It might be update issue but cannot figure out which one.

    Sheetal

    Saturday, May 31, 2014 2:23 AM
  • sheetal,

    It appears your problem is that your SelectUserlists control does not contain a child control that can be set with the string "Jeffrey. miller".

    If SelectUserLists is a combobox, I would expand the control and spy on its items. You will probably find that the string "Jeffrey. miller" does not correspond exactly to any of the child control's DisplayText properties.

    Best,


    Saturday, May 31, 2014 11:44 AM