Similar Blogs
How to do Headless Browser Testing in Selenium?
0 mins read
2023-09-07
Advanced Selenium Interview Questions – 2023
0 mins read
2023-09-07
Everything You Should Know About Waits in Selenium
0 mins read
2023-09-13
XPath in Selenium
0 mins read
2023-09-13
What is Selenium Testing?
0 mins read
2023-09-13
How To Do Cross Browser Testing In Selenium?
0 mins read
2023-09-08
What Is Parallel Testing In Selenium?
0 mins read
2023-09-08
Top Selenium Interview Questions – 2023
0 mins read
2023-09-14
How do I automate in Selenium?
0 mins read
2023-09-07
What Is Test Automation Framework?
0 mins read
2023-09-07
Open Visual Studio
Click on File >> New >> Project
In New Project template,
Click on OK.
After successful creation of project, below screen would be displayed:
To install the Selenium WebDriver, follow the below steps:
Click on Tools >> NuGet Package Manager >> Manage NuGet Package for Solution…
In the next screen,
Review the changes and click on OK in the Preview pop-up.
After successful install of Selenium WebDriver, below message will be displayed in Output window.
We would be executing our Selenium scripts as well as automating any web application in Chrome browser. Hence, to launch the Chrome browser, we need to have ChromeDriver downloaded in the system.
To download ChromeDriver, follow the below steps:
Click on Help >> About Google Chrome.
In the next screen, Chrome version is displayed in About Chrome section
Open below link to download ChromeDriver:
https://chromedriver.chromium.org/downloads
Based on the Chrome browser version, click on the ChromeDriver download link:
On click of the download link, a window will open specifying the chromeDriver for various platforms. Download the one according to your system’s configuration.
On click of the link, ChromeDriver zip file will get downloaded. Unzip the file and place it in some folder.
Right click on Project and click on Add >> New Item…
In Add New Item template, click on Class under Visual C# items and provide the Name as DLADemo.cs and click on Add button.
In Add New Item template, click on Class under Visual C# items and provide the Name as DLADemo.cs and click on Add button.
New class DLADemo.cs will get added to the project.
Write the following code in DLADemo.cs file:
Open the Program.cs and write the following code in Main method.
Click on Start to run the application.
Browser will open and run the scripts written and browser will get closed.
To install the NUnit Framework, follow the below steps:
Click on Tools >> NuGet Package Manager >> Manage NuGet Package for Solution…
In the next screen,
Review the changes and click on OK in the Preview pop-up.
Review the changes and click on OK in the Preview pop-up.
Click on Tools >> NuGet Package Manager >> Manage NuGet Package for Solution…
In the next screen,
Review the changes and click on OK in the Preview pop-up.
After successful install of NUnit Test Adapter, below message will be displayed in Output window.
Write the below code in DLADemo.cs file.
Click on Build >> Build Solution.
Once the build is successful, click on Test >> Windows >> Test Explorer.
Test Explorer window will be opened and the test script with annotation Test(“OpenUrl”) will be displayed in the Test Explorer window.
Select the test and right click on it. Click on Run Selected Tests.
Selenium will open the browser, then execute the test script and will close the browser and test case will get passed and will be displayed under Passed Tests in Test Explorer window.
INQUIRE
By tapping continuing, you agree to our Privacy Policy and Terms & Conditions
SkillAhead Solutions
Gurgaon
USA
1603, Capitol Avenue, Suite 413A, 2659, Cheyenne, WY 82001, USA
COURSE CATEGORIES
`Copyright © DevLabs Alliance. All rights Reserved`
|
Refund & Reschedule Policy
Privacy Policy
Terms of Use