Test run unable to find drop down

4 posts, 0 answers
  1. Tomer
    Tomer avatar
    3 posts
    Member since:
    Mar 2016

    Posted 08 Mar 2016 Link to this post


    I have recorded a test, as one of the test steps are clicking on a drop down menu.

    I changed opened a feature in our UI which causes it to change a bit (some tabs added). After the change, the tests failed and from what I could see is that the button ID changed.

    It tries this:


    After I opened the feature on the test server, seems like the button id changed (1490).

    Any way to run this using a regex to capture the id?






    Exception thrown executing coded step: '[WebTest_CodedStep] : Click 'Button1486BtnIconElSpan''.
    ArtOfTest.Common.Exceptions.FindElementException: Element Not found!
    FindExpression used: 
    [id 'Exact' button-1486-btnIconEl] AND [tagname 'Exact' span]

       at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo, Object target)
       at ArtOfTest.Common.WaitSync.For[T,V](Func`3 func, T target, V custom, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType)
       at ArtOfTest.WebAii.Synchronization.Wait.ForCondition(Func`3 condition, Boolean invertCondition, Object custom, Int32 timeout, WaitResultType errorResultType)
       at ArtOfTest.WebAii.Synchronization.Wait.ForExists(Int32 timeout, Boolean refreshElement)
       at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.GetElement(HtmlFindExpression expr, Boolean waitOnElement, Int32 timeout)
       at ArtOfTest.WebAii.TestTemplates.ElementContainer`2.Get(TFindExpression expr, Boolean waitOnElement, Int32 timeout)
       at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get(HtmlFindExpression expr)
       at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get[TControl](HtmlFindExpression expr)
       at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get[TControl](String[] clauses)
       at TestProject1.Pages.KenshooPage.FrameMainViewIframeFrame.get_Button1486BtnIconElSpan() in c:\Users\tomeri\Documents\Test Studio Projects\TestProject1\Pages.g.cs:line 115
       at TestProject1.WebTest.WebTest_CodedStep() in c:\Users\tomeri\Documents\Test Studio Projects\TestProject1\WebTest.tstest.cs:line 53

  2. Sailaja
    Sailaja avatar
    7 posts
    Member since:
    Dec 2014

    Posted 08 Mar 2016 Link to this post

    Hi Tomer,

    I have a question here. Is there any other unique attribute to identify Button element (ex: Button Name).

    Generally Id is always dynamically created and so we cannot rely on that. If your developers use Unique Id for each element then we rely on Id. 

    So I suggest to add an unique attribute to identify the Button element.




  3. Tomer
    Tomer avatar
    3 posts
    Member since:
    Mar 2016

    Posted 10 Mar 2016 in reply to Sailaja Link to this post

    Unfortunately, no.

    I will take this with our dev team.



  4. Elena
    Elena avatar
    1230 posts

    Posted 11 Mar 2016 Link to this post

    Hello Tomer,

    Thank you for contacting us. 

    @ Sailaja: Thank you for your reply. 

    As far as I can see from the details you shared the only changing part of your button ID is the numeric part. You could change the criteria how the button ID is searched - instead of using exact match for the whole ID you could use starts with/ends with (see the attached screenshot). 
    In addition to Sailaja's suggestion I could add that a possible unique attribute that you could use is the actual text content of each drop-down menu elements.  

    Another helpful thing to do to sort out where the issue comes from, could be if you record the failing test step again and check its behavior by playback. 

    In case this is not applicable in your case, please share further details on your issue. Please provide us the failing step details - in order to do so double click the red X on the failing step and export the details. Here is a short video demonstration (no audio) on how to provide the appropriate information for investigation.

    Looking forward to hearing from you. 

    Elena Tsvetkova
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top