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

Publicado em: 13 Julho 2020
no canal de: 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();
}


Nesta página do site você pode assistir ao vídeo on-line Selenium with C# 66 - Selenium data driven testing using MS SQL as data source in MS Test duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Ankpro Training 13 Julho 2020, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 5,705 vezes e gostou 42 espectadores. Boa visualização!