Display results as :

Rechercher Advanced Search

Latest topics
» Geting issues in identifying the elsements in webdriver
Fri Feb 17, 2017 4:41 pm by janbaskt

» WebDriver - why not to use a singlton for it?
Fri Feb 17, 2017 4:40 pm by janbaskt

» WebDriver session when using testng annotation to invoke driver instance
Fri Feb 17, 2017 4:39 pm by janbaskt

» Selenium fails to launch Chrome
Fri Feb 17, 2017 4:39 pm by janbaskt

» why do i get this error
Fri Feb 17, 2017 4:38 pm by janbaskt

» Selenium Tutorial
Thu Feb 16, 2017 5:21 pm by Rahul

» When to use Selenium IDE, RC and WebDriver
Mon Feb 13, 2017 2:35 pm by azharuddin

» How to integrate selenium with ZAPI-Zephyr
Sat Feb 11, 2017 2:25 am by gseera002c

» Selenium Webdriver
Sat Feb 04, 2017 6:47 pm by


How to get the count of repeated word from the bodytext?

View previous topic View next topic Go down

How to get the count of repeated word from the bodytext?

Post by Priyanka on Wed Oct 13, 2010 2:28 pm


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

Regular Participant
Regular Participant

Posts : 27
Join date : 2010-10-04

Back to top Go down

Re: How to get the count of repeated word from the bodytext?

Post by Adviser on Fri Nov 26, 2010 11:17 pm


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



Posts : 379
Join date : 2009-07-30
Location : India

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum