+ All Categories
Home > Software > Run Selenium Tests With Microsoft Test Manager

Run Selenium Tests With Microsoft Test Manager

Date post: 16-Apr-2017
Category:
Upload: daniel-herken
View: 280 times
Download: 5 times
Share this document with a friend
21
Daniel Herken [email protected] http://www.browseemall.com Selenium Tests Using Microsoft Test Manager MTM & Selenium
Transcript
Page 1: Run Selenium Tests With Microsoft Test Manager

Daniel [email protected]://www.browseemall.com

Selenium Tests Using Microsoft Test Manager

MTM & Selenium

Page 2: Run Selenium Tests With Microsoft Test Manager

Today we will cover

1. What is Microsoft Test Manager?2. What is Selenium?3. Requirements & Setup4. Selenium on Test Agent5. BrowseEmAll on Test Agent

Introduction

Page 3: Run Selenium Tests With Microsoft Test Manager

What is Microsoft Test Manager?Microsoft Test Manager (MTM) is the test management framework by Microsoft. It support manual and automated testing side-by-side.

Page 4: Run Selenium Tests With Microsoft Test Manager

Supported by all major browser vendors:

What is Selenium?

Free and open source browser automation framework.

Page 5: Run Selenium Tests With Microsoft Test Manager

What is Selenium?

How does it work?

Your Code

Page 6: Run Selenium Tests With Microsoft Test Manager

What is Selenium?

How does it work?

Your Code Selenium

Page 7: Run Selenium Tests With Microsoft Test Manager

What is Selenium?

How does it work?

Your Code Selenium

IEDriver

EdgeDriver

FirefoxDriver

ChromeDriver

Page 8: Run Selenium Tests With Microsoft Test Manager

What is Selenium?

How does it work?

Your Code Selenium

IEDriver

EdgeDriver

FirefoxDriver

ChromeDriver

Internet Explorer

MicrosoftEdge

Firefox

Chrome

Page 9: Run Selenium Tests With Microsoft Test Manager

Supports automation of all major browsers:

What is Selenium?

Which browsers are supported?

Page 10: Run Selenium Tests With Microsoft Test Manager

Selenium language bindings are available for:

• Java• C#• Ruby• Python• JavaScript• Perl (third-party)• PHP (third-party)

What is Selenium?

Which programming languages are supported?

Page 12: Run Selenium Tests With Microsoft Test Manager

• Create new tests in Test Manager• Map tests to Unit Tests• Create Environment• Assign to Test Plan in Test Manager

Requirements & Setup

Configure Test Plan:

Page 13: Run Selenium Tests With Microsoft Test Manager

Requirements & Setup

Demo

Page 14: Run Selenium Tests With Microsoft Test Manager

• Install Java: https://java.com/en/download/ • Install Firefox: https://www.mozilla.org• Install Google Chrome: https://www.google.com/chrome/browser/desktop/• Add c:\Selenium to your PATH

Selenium on Test Agent

Requirements

Page 15: Run Selenium Tests With Microsoft Test Manager

o Internet Explorer Driver:• Download (32bit or 64bit) http://www.seleniumhq.org/download/• Extract to c:\Selenium

o Chrome Driver:• Download https://sites.google.com/a/chromium.org/chromedriver/• Extract to c:\Selenium

o Firefox Driver:• Download https://github.com/mozilla/geckodriver/releases• Extract to c:\Selenium

Selenium on Test Agent

Installing Drivers

Page 16: Run Selenium Tests With Microsoft Test Manager

Selenium on Test Agent[TestMethod] public void GoogleForSelenium() {      // Launch new instance for Firefox      IWebDriver driver = new FirefoxDriver();     

// Navigate to google      driver.Navigate().GoToUrl("http://www.google.com");     

// Find the input field for the search query      IWebElement inputField = driver.FindElement(By.Name("q"));     

// Add some text to the input field      inputField.SendKeys("Selenium");     

// Submit the search      inputField.Submit();     

// Google uses JS to render the results page so we need to wait       var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));      wait.Until(o => o.Title.StartsWith("Selenium", StringComparison.OrdinalIgnoreCase));     

// Use asserts like you would in unit tests      Assert.IsTrue(driver.Title.StartsWith("Selenium", StringComparison.OrdinalIgnoreCase));     

// close down the browser      driver.Quit(); }

Page 17: Run Selenium Tests With Microsoft Test Manager

Selenium on Test Agent

Demo

Page 18: Run Selenium Tests With Microsoft Test Manager

o Internet Explorer Driver:• Download (32bit or 64bit) http://www.seleniumhq.org/download/• Extract to c:\Selenium

o Chrome Driver:• Download https://sites.google.com/a/chromium.org/chromedriver/• Extract to c:\Selenium

o Firefox Driver:• Download https://github.com/mozilla/geckodriver/releases• Extract to c:\Selenium

BrowseEmAll on Test Agent

Installing Drivers

Page 19: Run Selenium Tests With Microsoft Test Manager

BrowseEmAll on Test Agent[TestMethod] public void GoogleForSeleniumOnGrid() {      // Launch new instance for Firefox      IWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), DesiredCapabilities.Firefox());     

// Navigate to google      driver.Navigate().GoToUrl("http://www.google.com");     

// Find the input field for the search query      IWebElement inputField = driver.FindElement(By.Name("q"));     

// Add some text to the input field      inputField.SendKeys("Selenium");     

// Submit the search      inputField.Submit();     

// Google uses JS to render the results page so we need to wait       var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));      wait.Until(o => o.Title.StartsWith("Selenium", StringComparison.OrdinalIgnoreCase));     

// Use asserts like you would in unit tests      Assert.IsTrue(driver.Title.StartsWith("Selenium", StringComparison.OrdinalIgnoreCase));     

// close down the browser      driver.Quit(); }

Page 20: Run Selenium Tests With Microsoft Test Manager

BrowseEmAll on Test Agent

Demo

Page 21: Run Selenium Tests With Microsoft Test Manager

Questions?

Q & A


Recommended