Pages

Search This Blog

Thursday, October 21, 2010

How to verify the text ignoring cases sensitivity in selenium ?

How to verify the text ignoring cases sensitivity in selenium ?

Some times we need to verify the text on the webpage no matter is upper cases or lower cases or proper.
We just need to verify the text on the web page ignoring their cases sensitivity.
REGEXPI is used to avoid cases sensitive to verify the text on the page.

Lets say i want to verify the text "Automationtricks is good blog for selenium" No matter its in upper cases or lower case or proper case.

Then use REGEXPI in selenium command selenium.isTextPresent or verifyTextPresent.


<tr>
    <td>verifyTextPresent</td>
    <td>regexpi:AUTOMATIONTRICKS IS GOOD BLOG FOR SELENIUM</td>
    <td></td>
</tr>

<tr>
    <td>verifyTextPresent</td>
    <td>regexpi:AUTOMATIONTRICKS is good blog for selenium</td>
    <td></td>
</tr>

<tr>
    <td>verifyTextPresent</td>
    <td>regexpi:AUTOMAtionTRICKS Is GoOd Blog for SELENIUM</td>
    <td></td>
</tr>

<tr>
    <td>verifyTextPresent</td>
    <td>regexpi:automationtricks is good blog for selenium</td>
    <td></td>
</tr>


In Selenium RC

verifyTrue(selenium.isTextPresent("regexpi:AUTOMATIONTRICKS IS GOOD BLOG FOR SELENIUM"));

verifyTrue(selenium.isTextPresent("regexpi:AUTOMATIONTRICKS is good blog for selenium"));

verifyTrue(selenium.isTextPresent("regexpi:AUTOMAtionTRICKS Is GoOd Blog for SELENIUM"));

verifyTrue(selenium.isTextPresent("regexpi:automationtricks is good blog for selenium"));


11 comments:

  1. It's awesome to pay a visit this web page and reading the views of all colleagues concerning this article, while I am also eager of getting experience.
    My web site: Loans for Bad Credit

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. I think this іs аmong the most important info for me.
    And і am glad reading your aгticle.
    But wanna remаrk on somе general
    thіngs, The ωebsitе stуle іs ideal, the articles iѕ really nice :
    D. Gοoԁ job, cheeгs

    Heгe is my sіte ... New Bingo Sites

    ReplyDelete
  4. Heyа i'm for the first time here. I found this board and I find It really useful & it helped me out a lot. I hope to give something back and aid others like you helped me.

    Visit my blog post payday loans

    ReplyDelete
  5. How can implement this in Selenium Webdriver? Anyone can help!!!

    ReplyDelete
    Replies
    1. You can download directly from here, following examples: There's version 3 available in beta, but you will need to also download selenium server if you use this one:
      http://www.seleniumhq.org/download/

      Delete
  6. Thanks for posting.so nice and mind blowing post
    USB Cables
    http://companies.telecomb2b.com/mobile-charger-parts-and-components/usb-cables.html

    ReplyDelete
  7. Thanks for sharing great information in your blog. Got to learn new things from your Blog . It was very nice blog to learn about Selenium.
    Selenium

    ReplyDelete
  8. It was very nice blog to learn about SAP HR.Thanks for sharing new things.SAP HR

    ReplyDelete
  9. It was very nice blog to learn about Selenium.Thanks for sharing new things.selenium training in chennai

    ReplyDelete