19

Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object
Page 2: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

Web Front End Automation w/ Selenium

and PowerShell

Collin SkilesProgrammer Analyst, Willamette University

Page 3: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

Session Rules of Etiquette

• Please silence your devices

• If you must leave early, please be discreet

• Please avoid side conversations

– But if you have a germane observation, please share!

• Questions are welcome at any time

Page 4: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

Introduction

• What is “front end automation”?

– Why use it?

• What is Selenium?

• Why PowerShell?

• How do I get started?

Page 5: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

What is “front end automation”?

• Various meanings– Business

– Software Development

• Our context

• Uses for web front end automation– Regression testing

– Automation of repetitive tasks

• Saves users time on manual tasks

Page 6: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

What is Selenium?

• Selenium automates browsers

• Can be used for various purposes

– Testing

– Administration

– Whatever…

• Integrated with many browsers

• Bindings for many languages

Page 7: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

Why PowerShell?

• Windows environment was desired

• No additional software needed

• .NET Framework Classes can be used

• No build overhead

Page 8: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

How do I get started?

• Download the Selenium C# language bindings

• Download the browser drivers

• Load the .NET language assemblies into your PowerShell session

• Start coding!

Page 9: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

Case Study: Colleague UI5

• Migration to HTML5 opens way for browser automation

• Example: Automate creation of PERSON record using NAE and BIO

Page 10: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

Case Study: Colleague UI5

• Load libraries

• Create a WebDriver object

• Call object methods to interact with the browser

• Demo Time!

Page 11: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

Brief Overview of WebDriver Methods

• Navigate()

– GoToUrl(String)

– Back()

• FindElementById(String)

– SendKeys(String)

– Click()

• FindElementByXPath(String)

Page 12: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

More Features

• Get tag attributes and text

• Switching between frames

• Interacting with complex page objects– Drag and Drop

– Multiple Select

• Clicking on specific page coordinates

• Executing JavaScript snippets– Can be used to scroll down a page manually

Page 13: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

Actual Business Use

• ACES2 Document Download– Law School CRM

– Required by Bar Association

• Technolutions Slate Integration

• Download documents from ACES2

• Upload Documents to Slate

• Problem: ACES2 only accessible via web interface

Page 14: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

Actual Business Use

Page 15: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

Actual Business Use

Page 16: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

Actual Business Use

Page 17: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

Actual Business Use

• Solution: Use automation to download file

• Difficulties

– ACES2 markup and erratic website behavior

– Downloading a file

• Successes

– One PowerShell script can handle process from start to end

Page 18: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

Conclusion

• Powerful tools for automating workflows

– (Relatively) Easy to implement

– Well documented

– Free!

• Questions?

Page 19: Web Front End Automation w/ Selenium · Web Front End Automation w/ Selenium and PowerShell Collin Skiles Programmer Analyst, Willamette University. ... •Create a WebDriver object

Thank you for coming!

Link to example code

Collin Skiles

Programmer Analyst, Willamette University

[email protected]