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

  • Home
  • SEARCH
  • 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 4104100
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:04:33+00:00 2026-05-20T21:04:33+00:00

Perl-Selenium also provides the standard methods of Test::More such as ok(), like(), is(), etc

  • 0

Perl-Selenium also provides the standard methods of Test::More such as ok(), like(), is(), etc , also as object methods, e.g. $sel->like().

($sel is the selenium perl object)

Should these object methods be used at all? Which one is preferred?

I am puzzled because like() and $sel->like seem to behave differently in places.
Here I assume text is indeed found on the page.

like( $found, qr /$text/, "found '$text' on page" ) ; # WORKS FINE

 # DOES NOT WORK, ERROR:    "doesn't look much like a regex to me."
$sel->like( $found, qr/$text/ , "found '$text' on page")

So it seems the pure like() method is preferable to $sel->like()?

  • 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-20T21:04:34+00:00Added an answer on May 20, 2026 at 9:04 pm

    It looks like Test::WWW::Selenium does not itself provide like method, but rather many methods like title_like or text_like.

    That gives us either

    like( $found, qr /$text/, "found '$text' on page" );
    

    or

    $sel->text_like('id', qr/$text/, "found '$text' on page");
    

    Edit: There is like method available in Test::WWW::Selenium, but when dumped, it looks like this:

    sub {
        my $tb = 'Test::More'->builder;
        return $tb->like(@_);
    }
    

    it means that by calling as $sel->like(...) you are adding one extra parameter ($sel) to the method call. The method is remnant of Test::Builder inheritance and it likely not supposed to be used directly.

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

Sidebar

Related Questions

I'm using Selenium to unit test my Perl cgi script and all works fine
Perl has quite a few special variables such as @F , $! , %!
In Perl, you are able to call a function by reference (or name) like
In Perl, if I want to use named parameters in an object constructor, my
Perl and some other current regex engines support Unicode properties, such as the category,
I am writing some Selenium RC tests using the perl library WWW::Selenium. At the
I had a large number of Selenium based perl Testscripts. After the complete Testing
In Perl, how do I combine these 2 statements in one line? $str=~ s/=>/:/g;
I have a Perl script that uses Selenium to fetch a HTML document called
In Perl, if you have a loop like this: foreach (@items) { perform_action($_); }

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.