In this session I describe how to create UI Tests using Selenium, MSTest, and C# on Visual Studio 2017. I also describe PageObjects, which allow me to create more readable tests.
2. About Me
Microsoft MVP forVisual Studio and Development
Technologies
Lead, Philippine .NET Users Group
PSIATechnical Council Member
http://jonlimjap.net
@lattex | jonlimjap@gmail.com
6. What is
Selenium?
Quite simply, “Selenium automates
browsers”
Originally started in 2004 by Jason
Huggins as an internal tool at
ThoughtWorks
Written in Java
Useful not only for testing but for
automated tasks, webpage scraping, etc.
13. Find Elements
By
FindElement/FindElements returns a
WebElement object
These are filtered using the “By” object
ClassName
CssSelector
Name
Id
LinkText
PartialLinkText
TagName
Xpath
Chrome DeveloperTools is your friend
Copy Selector
Copy XPath
15. Selenium in
VisualStudio
Third parties found ways to support
Selenium as early asVisual Studio 2005
via NUnit and Selenium.NET
MSTest support added inVisual Studio
2013
You can still use NUnit or other test runners
Vastly easier nowadays due to Nuget
18. PageObjects
Create a class representing each page to
be tested
Create properties forWebElements in the
page
Make methods for repeatedly called
routines