Skip to main content

How to verify a particular user is available in the database or not?

UseWe can achieve this articlein whenfour steps:

    Need a ScenarioSQL Editor or Service Suite validation needsfile to confirmretrieve whetherthe data from the database

    Need a specificservice usersuite recordscript existsto run the SQL query and store it in a database.variable to compare

    Validation

    workflow
    1. Identify

      Need a CSV file that contains the unique user keyor users

    Implementation in .ds script

    For step-1 we have to validate, such as username, user ID, or test email.

    Runcreate a parameterizedSQL queryfile throughin the approvedbelow AIQformat: database/service
    workflow.Assert
    -- dbvendor=MYSQL
    -- username=XXXX
    -- password=XXXX
    -- host=localhost
    -- schema=XXXX
    -- port=3306
    -- connect
    -- limit=1-10
    -- tag=executedScenarios
    SELECT * from DATABASENAME.TABLENAME
    -- storeInLocker=
    -- disconnect

    For step-2, below are the expectedsyntax rowfor countservice orsuite fieldscript:

    value,
    then
    processSQLFile("{ds}/sqlScript.sql");
    runvar aresult negative= caseJSON.parse(locker.get("executedScenarios"));
    tolog(result);
    confirmvar xyz;
    locker.put("xyz",result);

    For step-3, use any CSV in below format:

    For step-4, use the validationbelow canstep

    fail

    correctly.


    Last updated: SeptemberAugust 29,03, 20262023

    If you have any feedback on this topic, please contact us at documentation@appvance.ai