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

Published: 13 July 2020
on channel: Ankpro Training
5,705
42

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.Url = "http://uitestpractice.com/Students/Cr...";

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());
driver.FindElement(By.XPath("//input[@type='submit']")).Click();

Thread.Sleep(2000);
driver.Quit();
}


On this page of the site you can watch the video online Selenium with C# 66 - Selenium data driven testing using MS SQL as data source in MS Test with a duration of hours minute second in good quality, which was uploaded by the user Ankpro Training 13 July 2020, share the link with friends and acquaintances, this video has already been watched 5,705 times on youtube and it was liked by 42 viewers. Enjoy your viewing!