Protractor: After selecting radio buttons for a set of questions on webpage, how do i validate the same is reflecting on table or not [closed]

左心房为你撑大大i 提交于 2020-12-13 04:01:52

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!