Tuesday, October 26, 2010

Tip #13: Checking for empty variable using IF controller

Sometimes you need to add HTTP samplers with dynamic URL or with dynamic part of the URL which are stored in some variable after HTTP sampler post-processing.



But if Regular Expression Extractor will not find any matching string result variable will be set to default value (empty value in our case). We should test this variable for emptyness before we will use it.


Now if the News page has not any news we are sure that JMeter will handle this situation correctly.

1 comment:

  1. Dear Victor,

    I followed same method mentioned here. But My Jmeter is not making any connections to the database. I copied jdbc drivers into /lib directory as followed.
    sqljdbc_auth.dll
    sqljdbc_xa.dll
    sqljdbc
    sqljdbc4

    These Errors we are facing in Jmeter Log Files -
    WARN – jmeter.protocol.jdbc.config.DataSourceElement: Could not return Connection java.sql.SQLException: No suitable driver found for jdbc:sqlserver://serverip:1433;databaseName=dbname

    WARN – jmeter.protocol.jdbc.config.DataSourceElement: Could not return Connection java.lang.Exception: Could not create enough Components to service your request (Timed out).

    Please response us asap
    Thanks & Regards
    Vinay Bansal
    vinay.bansal@qbitsystems.com

    ReplyDelete