HtmlSpan click not working with exact text

2 posts, 0 answers
  1. Arvind Dhiman
    Arvind Dhiman avatar
    6 posts
    Member since:
    Apr 2010

    Posted 31 Jul Link to this post

    I am facing an issue with Htmlspan clicking over a Menu Item. The issue is if I am using the below code (for example) it is working fine

     

    HtmlSpan menu = manager.ActiveBrowser.Find.ByExpression<HtmlSpan>("tagname=span", "TextContent=~Management Process");

    menu.Click(false);

     

    But, when I am using this code it is not working

    HtmlSpan menu = manager.ActiveBrowser.Find.ByExpression<HtmlSpan>("tagname=span", "TextContent=Management Process Dynamic");
    menu.Click(false);

    I am not able to understand why the exact TextContext is not working, I can't rely on the partial one, because multiple menu items can start with the same name (not now but may be in future). Please let me know if I need to change the Find Expression or I am missing something.

     

    Regards,

    Arvind Dhiman

  2. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    254 posts

    Posted 04 Aug Link to this post

    Hi Arvind,

    I reproduced your scenario on my end but did not observe the described behavior. I managed to find the HtmlSpan using both the exact and the partial text with the find expressions you listed. Please let me know further details in order to assist you on that topic. Could you provide your page or at least part of your Html code so that I could test it? 

    Thank you! 

    Regards,
    Elena Tsvetkova
    Telerik by Progress
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top