Combobox.Text throws exception

5 posts, 0 answers
  1. Asta
    Asta avatar
    29 posts
    Member since:
    Nov 2011

    Posted 11 Feb 2013 Link to this post

    When i try to get combobox Text appears exception:
     
    ArtOfTest.Common.Exceptions.FindElementException : Unable to find the specified element: Unable to find the element of type: textblock
    at ArtOfTest.WebAii.Silverlight.SilverlightProxy.ExecuteSLCommand(SilverlightCommand cmd)
    at ArtOfTest.WebAii.Silverlight.SilverlightProxy.GetProperty(AutomationProperty property, IAutomationPeer peer)
    at ArtOfTest.WebAii.Silverlight.AutomationObject`1.GetProperty(AutomationProperty property)
    at ArtOfTest.WebAii.Silverlight.UI.TextBlock.get_Text()
    at ArtOfTest.WebAii.Silverlight.FrameworkElement.get_Text()

    if (!box.Text.Equals(value)) // <- Here appears exception
               {
                   box.OpenDropDown(false);
                   box.Refresh();
                   ComboBoxItem item = box.Items.FirstOrDefault(i => i.Text.Trim().Contains(value.TrimValue()));
                   Stopwatch watch = Stopwatch.StartNew();
                   while (item == null && watch.ElapsedMilliseconds < 30000)
                   {
                       box.Refresh();
                       item = box.Items.FirstOrDefault(i => i.Text.Trim().Contains(value.TrimValue()));
                   }
                   watch.Stop();
     
                   if (item != null)
                   {
     
                       item.IsSelected = true;
                       box.IsDropDownOpen = false;
                       return true;
                   }
     
                   box.IsDropDownOpen = false;
                   return false;
               }
               return true;

  2. Boyan Boev
    Admin
    Boyan Boev avatar
    1043 posts

    Posted 12 Feb 2013 Link to this post

    Hi Asta,

    The error message seems to suggest that Test Studio was unable to find an element that it was looking for. We have a standard error message for this kind of thing. I'm not sure why you got this error message instead. But you should still be able to follow our troubleshooting guide in order to get this resolved. Please check out these articles:

    - Change How an Element Is Found

    - Unable to locate element failures
    You can try to add a WaitForExists to the element you are looking for. It may appear slowly causing the step to fail.

    If the issue persists please send us a screen shot of the DOM tree and provide us please with a bigger code snippet (i.e. the part with the find expression).

    Hope to hear from you soon.
     

    All the best,
    Boyan Boev
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Sarika
    Sarika avatar
    1 posts
    Member since:
    Nov 2014

    Posted 04 Nov 2014 Link to this post

    For RadCombobox my test cases is getting failed as its not able to locate the element. Attaching the error log,no sure why its not able to locate this. Please help me figure out what could be the issue?
  4. Sarika
    Sarika avatar
    1 posts
    Member since:
    Nov 2014

    Posted 04 Nov 2014 Link to this post

    My Test cases are getting failed for Combo box,its giving error saying its not able to locate the element, Attaching error log reference.
    Please help me to figure out what could be error cause?
  5. Boyan Boev
    Admin
    Boyan Boev avatar
    1043 posts

    Posted 07 Nov 2014 Link to this post

    Hi Sarika,

    Thank you for contacting us.

    It seems that you were not able to attach the log file. 

    In order to help you best please:

    1. Re-attach the log.

    2. Send us the code you are using for selecting the combo box.

    3. Please send us a screen shot of the DOM tree where the combo box is.

    Looking forward to hearing from you.

    Regards,
    Boyan Boev
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top