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 7605715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:14:13+00:00 2026-05-31T00:14:13+00:00

I have next html code: <ul class=nav> <li class=active> <a href=/users/page>Page</a> </li> … </ul>

  • 0

I have next html code:

<ul class="nav">
    <li class="active">
      <a href="/users/page">Page</a>
    </li>
    ...
</ul>

I want to make sure that i have li tag with class “active” and inside of that text.

So, i tried that:

response.should have_selector( "li", :class => "active" ,:content => "Page")

And it doesn’t work, i get such error:

Failure/Error: response.should have_selector( "li", :class => "active" ,:content => "Page")
       expected following output to contain a <li class='active'>Page</li> tag:

How can i solve my problem?

  • 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-31T00:14:14+00:00Added an answer on May 31, 2026 at 12:14 am

    I solved it:

    response.body.should have_selector( "li.active") do
       have_selector('a', :content => 'Pages')
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the next code: Process p = Runtime.getRuntime().exec(args); and I want my program
So I have this bit of python code that runs through a delicious page
I have the following HTML code: <div class=container> <span class=red></span> <span class=hot></span> </div> On
I am try using prototype javascript framework. i have next code CheckBoxSlider = Class.create({
I have HTML Content which was being displayed in a UITextView . The next
I have next tables Order , Transaction , Payment . Class Order has some
I'm going to start of by noting that I have next to no python
I have the next query that I run via SQLCMD.EXE use [AxDWH_Central_Reporting] GO EXEC
I have the next code in javascript. I deleted some unnecessary items because it
I have the following code which is parsing a HTML table as simply as

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.