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();
}
Auf dieser Seite können Sie das Online-Video Selenium with C# 66 - Selenium data driven testing using MS SQL as data source in MS Test mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Ankpro Training 13 Juli 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 5,705 Mal angesehen und es wurde von 42 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!