• Automation

    Selenium IDE: Regular Expression Pattern

    An idea to verify the correct format (eg: email format, phone number format) is simple. We need the “Regular Expression Pattern” of each format and using Selenium IDE to compare, the result will be Passed if your value match with Regular Expression Pattern, and Failed if your value does not match with that format pattern.

    There are some common Regular Expression Pattern, but you can customize to meet the business if needed.

    Email Regular Expression Pattern.

    Generic email address.

    Match a date in ‘mm/dd/yyyy’ format with any of the ‘-’, ‘/’, ‘.’ as separators.

    Date Format (dd/mm/yyyy).

    Password Regular Expression Pattern.

    Username Regular Expression Pattern.

    URL Regular Expression Pattern.

    ————–

    Example: Verify email and compare with Email Regular Expression Pattern by using Selenium IDE.

    Command____Target____Value
    verifyText ____ css=h1 ____(Regular Expression Pattern)

    Regular Expression Pattern

  • Automation,  Security

    Bypass the basic math Captcha

    When I’m looking for the code of simple Captcha for my personal project, I found this solution: http://html-tuts.com/simple-php-captcha/

    The idea of this Captcha is simple, user needs to input the correct value of basic calculating: A+B

    Simple Captcha Code with PHP - Mozilla Firefox 2016-06-02 01.34.38
    But from the view points of tester, I asked myself: How can I bypass and break it?

    I’m looking into the source code of demo Captcha site and there are some useful information there, with supporting of Selenium WebDriver I can make it very easy. Here’s my step:

    Source:

    Summary:
    – With web admin and developer: Do not use this simple way to protect your website from flooding or spam.
    – From hacker side: Can use this way or something similar to bypass the Captcha.
    – For tester: View the source code (front-end) and make a decision what you can test.