18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Regular expressions

arunbalaarunbala Members
edited November -1 in Sahi - Open Source
Hi narayan,
Eventhough i have tried all your techniques i got error while using regexp.

i just need a pattern for "You Have 9 Requests Pending". here the no. is the dynamic one.

Pls help me.

Comments

  • Hi arunbala

    try something like _yourElement.textContent.match(/\d/)

    regards
    Wormi
  • Hi wormi,
    Can pls explain this brief. I cant get u

    Pls help....
  • globalwormingglobalworming Moderators
    edited February 2012
    Hey..

    select the element where the text is... get the textContent.. then match the textContent against this regExp /\d/
    this will return all numbers in you text

    alternativly "You Have XXX Requests Pending".match(/You Have [0-9]+ Requests Pending/) will return this sentence with the numbers for XXX
    Just try it in your Sahi controller. Maybe you could explain in more detail what your problem is? What and where do you want to match, what shall be returned or selected?
Sign In or Register to comment.