问题
I am new to Protractor. I am trying to connect to database and check the table for the values i selected on the form in the webpage having 4 options available as radio button [Paris, Santorini, Florence, London] for each question, is reflecting in the table or not.
Suppose this is the table i have:
sr_id cities
1110011
1110012
1110013
1110014
1110015
1110016
1110017
1110018
1110019
1110020
1110021
1110022
After selecting from 4 options for the questions on the webpage and clicking on submit button, table will have the following data:
sr_id cities
1110011 Paris
1110012 Florence
1110013 Santorini
1110014 London
1110015 Florence
1110016 Paris
1110017 Paris
1110018 Florence
1110019 Santorini
1110020 Florence
1110021 London
1110022 Paris
Here is my code:
import { log4jsconfig } from '../../config/log4jsconfig';
import { any } from 'prop-types';
const sql = require('mssql/msnodesqlv8');
const poolPromise = new sql.ConnectionPool({
driver: 'msnodesqlv8',
server: "mydb.database.windows.net",
user: "user",
password: "password",
database: 'mydb',
port: 1433,
})
.connect()
.then((pool: any) => {
log4jsconfig.Log().debug('Connected to Database: mydb');
log4jsconfig.Log().debug('*******************************************', '\n');
return pool
})
.catch((err: any) => console.log('Database Connection Failed! Bad Config: ', err));
;
describe('European Cities', () => {
it('Select city for activities', async () => {
try
{
const pool = await poolPromise;
const result = await pool.request()
.query('What query should i do here !!')
log4jsconfig.Log().debug('\n',result);
}
catch(err)
{
console.log(err);
log4jsconfig.Log().debug('\n',err);
}
});
});
How to validate the database that whatever i options i selected is reflecting in database?
来源:https://stackoverflow.com/questions/64219479/protractor-after-selecting-radio-buttons-for-a-set-of-questions-on-webpage-how