Selenium with C# 66 - Selenium data driven testing using MS SQL as data source in MS Test

preview_player
Показать описание
Selenium data driven testing using MS SQL as data source in MS Test
#selenium #webdriver #automation #datadriventesting #qa

1:03 How to create a database table
2:12 Adding the data rows to the table
2:47 Code demo - Creation of test method
7:10 Test method execution
8:00 Possible interview questions on data driven testing using sql

Data driven testing using MS SQL and MS Test

How to create a database and table in MS SQL
Adding the data in to the table
Create a data driven test method which uses data from MS SQL table

Possible Interview Questions
1. How to use the MS SQL data as a source in selenium data driven testing?
2. What is a connection string?
3. What is the “Provider Invariant Name” for the MS SQL as data source?

Code :
[DataSource("System.Data.SqlClient",
"Server=.\\SQLExpress; Database=DataDrivenTesting;User Id=sa; Password=Ankpro01*",
"Student", DataAccessMethod.Sequential)]
[TestMethod]
public void DataDrivenTestingUsingSQL()
{
IWebDriver driver = new ChromeDriver();
driver.Manage().Window.Maximize();

driver.FindElement(By.Id("FirstName")).SendKeys(TestContext.DataRow[0].ToString().Trim());
driver.FindElement(By.Id("LastName")).SendKeys(TestContext.DataRow[1].ToString().Trim()); driver.FindElement(By.Id("EnrollmentDate")).SendKeys(TestContext.DataRow[2].ToString());

Thread.Sleep(2000);
driver.Quit();
}
Рекомендации по теме
Комментарии
Автор

Thank you for watching.
Cheers! would you mind hitting *_like_* button and *_subscribe_* to our channel!
That will be awesome. We would be grateful to you. And also share this video in your circle via whatsapp, facebook and twitter.
Video timeline :
1:03 How to create a database table
2:12 Adding the data rows to the table
2:47 Code demo - Creation of test method
7:10 Test method execution
8:00 Possible interview questions on data driven testing using sql

AnkproTraining
Автор

Is it possible to use DataSource to INSERT records instead?

KatRollo
Автор

Not run this program I try my local SQL server

aatishlute
Автор

HOw to add wait time if the query is taking long time to execute. I am getting time out error in selenium as the query is taking longer time than expected.

swagatmishra
Автор

Can any one help me I try this but not run

xentechno
join shbcf.ru