This is a migrated thread and some comments may be shown as answers.

HtmlSpan click not working with exact text

1 Answer 81 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Arvind Dhiman
Top achievements
Rank 1
Arvind Dhiman asked on 31 Jul 2016, 07:54 PM

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

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 04 Aug 2016, 07:20 AM
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
 
Tags
General Discussions
Asked by
Arvind Dhiman
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or