Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6047431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:21:01+00:00 2026-05-23T07:21:01+00:00

I am testing a website very similar to Google. So, if a user entered

  • 0

I am testing a website very similar to Google. So, if a user entered some search terms like “Selenium Tutorial”, the results page would have a bunch of links with snippets.

Each result is in a table. So, if there are 10 results, there are 10 tables.
For each table (result), there are several rows (say r1, r2, r3, etc). r1 is the title of the result, r2 is the description like size, format, author, etc, and r3 is the snippet. I need to make sure that r3 consits of the word(s) “selenium” “tutorial”. I tried doing something like:

String variable2 = Sel.GetTable("//div[@id='RepeaterContent']/table[2].3.1");

and this gave me the text in r3, the snippet. But, I need to get the text (snippet) of all tables (results). And perform a search on the snippet afterwards using something like contains.

I am not sure if the following code is much helpful because I am unable to copy the source code, but the source of the results page looks something like the following:

<HTML>
<BODY>
<DIV id="RepeaterContent">
<TABLE>
<TR>
  <TD>
    <SPAN>
      <a id="linkcft87021" class="ResultList_Title_Link" title="" href="DocsDetail.aspx?searchtranid=1bnt5d92" target="">Sample Tutorial</a>
      <br>
    </SPAN>
   </TD>
</TR>

<TR>
  <TD>
    ...an integrated development environment for performing Selenium tests...
  </TD>
</TR>
</TABLE>

<TABLE>
<TR>
  <TD>
    <SPAN>
      <a id="linkcft87021" class="ResultList_Title_Link" title="" href="DocsDetail.aspx?searchtranid=1g5t5d92" target="">Selenium</a>
      <br>
    </SPAN>
   </TD>
</TR>

<TR>
  <TD>
    ...With Selenium you can automate the whole process and run the test as required. In this part we will see how to create a simple test in Selenium... 
  </TD>
</TR>
</TABLE> 

</BODY>
</HTML>

And the following is my selenium test:

namespace Automation
{
    [TestClass]
    public class SEARCH
    {
        public ISelenium Sel;
        public string TestStatus = "FAIL";


        // Constructor
        public LIT_SEARCH_TAB()
        {
            Sel = new DefaultSelenium("localhost", 4444, "*iexplore", "http://localhost:8080");
      Sel.Start();
        }


        [TestMethod]
        public void SEARCH_METHOD()
        {
            Sel.Open("http://localhost:8080");
            Sel.Type("Search_Text_Box", "Selenium Tutorial");
            Sel.Click("Go");

         if (Sel.IsTextPresent("Selenium") || (Sel.IsTextPresent("Tutorial"))) 
         {
                   TestStatus = "PASS";
         }

       }
    }
}

So, I want to make sure that in the entire results page, there are words “Selenium” and “Tutorial”. Is there a way in Selenium that would meet my requirements? Some methods that would search for those keywords in the entire page, and verify the keywords are present? Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:21:01+00:00Added an answer on May 23, 2026 at 7:21 am

    You can use IsTextPresent(pattern) to check if a specific string is on the page. pattern can be one of glob, regexp or exact, the default is glob.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing some testing for a very large website, created many different developers.
While website loading speed testing I found that website is sometimes loading very quickly
Our website code is written in PHP. We have very little testing in regards
We've been using selenium with great success to handle high-level website testing (in addition
I would like to scrape some dynamic data off of a website. On the
We're using GWO (Google Website Optimizer) now. The multivariate and A/B testing is exactly
Duplicate: Testing a website for cross-browser/multiple-version support How do you test visual components I
I am testing a website in Firefox 8. I am using a jQuery.post call
Im just cross-browser testing my website. It is developed in Asp.net mvc 3. Throughout
I am a hobbyist webdesigner, use html and CSS for testing various website designs.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.