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
IdentifyNeed a CSV file that contains the
uniqueuserkeyor users
Implementation in .ds script
For step-1 we have to validate, such as username, user ID, or test email.
-- 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:
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
correctly.
Last updated: SeptemberAugust 29,03, 20262023
If you have any feedback on this topic, please contact us at documentation@appvance.ai