I tried to verify if the database value is equal to Success and Connection value is Up.
I am able to grab the database but unable to check the next line or the value of the Database using Cheerios.
Can anyone suggest what needs to be done to check the values of Database and Connection?
I have very limited knowledge of cheerio but this worked for me:
const $ = cheerio.load(pm.response.text());
pm.test("Database value is SUCCESS", function () {
pm.expect($('tr:nth-child(1) > td:nth-child(2)').text()).to.equal('SUCCESS');
});
pm.test("Connection value is SUCCESS", function () {
pm.expect($('tr:nth-child(2) > td:nth-child(2)').text()).to.equal('SUCCESS');
});
This was based on you having a HTML response that looks like this: