How to get the count of repeated word from the bodytext?
Page 1 of 1 • Share •
How to get the count of repeated word from the bodytext?
Hi,
I used selenium.getBodyText();
An example is given below
Mr ggg ggg DM Petrol QATEST 12:45:52
Mr lom sd QATEST 12:43:38
Mrs oui uio Enquiry about ... DM Diesel QATEST 12:36:34
The word QATEST is repeated in the bodytext. How can I get the count of that word from the bodytext?
FYI: Am writing selenium script using C#.
Please help..Tnx in advance
I used selenium.getBodyText();
An example is given below
Mr ggg ggg DM Petrol QATEST 12:45:52
Mr lom sd QATEST 12:43:38
Mrs oui uio Enquiry about ... DM Diesel QATEST 12:36:34
The word QATEST is repeated in the bodytext. How can I get the count of that word from the bodytext?
FYI: Am writing selenium script using C#.
Please help..Tnx in advance
Priyanka- Regular Participant

- Posts: 27
Join date: 2010-10-04
Re: How to get the count of repeated word from the bodytext?
Hi,
Yes you can do it very easily. Follow the steps:
1. get the page source code into a string variable.
2. now use the inbuilt function of strings which found the occurrence of particular string into that string
ex: Console.WriteLine(TextTool.CountStringOccurrences(s1, "Sam"));
3. now you have number of count.
wohooooo...............this is what you want. Hope this will help
Best of luck
Bye
Yes you can do it very easily. Follow the steps:
1. get the page source code into a string variable.
2. now use the inbuilt function of strings which found the occurrence of particular string into that string
ex: Console.WriteLine(TextTool.CountStringOccurrences(s1, "Sam"));
3. now you have number of count.
wohooooo...............this is what you want. Hope this will help
Best of luck
Bye
Similar topics» vginette extraction: File count limitation
» How to get the count of repeated word from the bodytext?
» WordCountTool.com - a word count tool
» Spell check & word count when posting
» Making Javascript word count box have a different text input colour
» How to get the count of repeated word from the bodytext?
» WordCountTool.com - a word count tool
» Spell check & word count when posting
» Making Javascript word count box have a different text input colour
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum

» sample webdriver code for php users
» which standalone server to use
» Dynamic Drop Down Selection
» It is possible to find list of all URL's exist in any web page in selenium ide
» It is possible to compare 2 same images in selenium IDE.
» how to compare 2 ULR's which is exist in same web page (View page source).
» Web Driver: Unable to click a link present inside the frame of a frameset
» Help me to get dynamicaly loaded options of dropdown in Selenium RC -Junit test case