Building a Driver: Lessons Learned From Developing the Internet Explorer Driver
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Building a Driver: Lessons Learned From Developing the Internet Explorer Driver

on

  • 1,594 views

 

Statistics

Views

Total Views
1,594
Views on SlideShare
1,480
Embed Views
114

Actions

Likes
1
Downloads
22
Comments
0

3 Embeds 114

http://microchipatwork.com 73
http://198.199.79.89 28
http://lanyrd.com 13

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Building a Driver: Lessons Learned From Developing the Internet Explorer Driver Presentation Transcript

  • 1. Building a Driver:Lessons Learned from Developingthe Internet Explorer DriverJim EvansLead Member of Technical Staff /jimevansmusic @jimevansmusic in/jimevansmusic
  • 2. Or:Jim EvansLead Member of Technical Staff /jimevansmusic @jimevansmusic in/jimevansmusic
  • 3. How I Learned to Stop Worrying andLove Internet ExplorerJim EvansLead Member of Technical Staff /jimevansmusic @jimevansmusic in/jimevansmusic
  • 4. Who Am I?
  • 5. A Little History (and some housekeeping)http://zyrus86.deviantart.com/art/Evolution-of-the-Geek-95267948
  • 6. Lesson 1: Be Language-Independent(for browser-independent things)
  • 7. Lesson 1a: Distribute a Standalone Executable(if you decided to use native code) •Written in native code •Examples: •chromedriver.exe •IEDriverServer.exe
  • 8. Lesson 2: Implement the JSON Wire Protocol (because RemoteWebDriver is your friend)http://www.flickr.com/photos/srhbth/487911150/sizes/o/in/faves-
  • 9. Lesson 2: Implement the JSON Wire Protocol(because RemoteWebDriver is your friend)
  • 10. Lesson 2: Implement the JSON Wire Protocol(because RemoteWebDriver is your friend) public class InternetExplorerDriver : RemoteWebDriver { private static int serverPort = 5555; private InternetExplorerDriverServer server; public InternetExplorerDriver() : base(new HttpCommandExecutor(new Uri("http://localhost:" + serverPort.ToString()), ( TimeSpan.FromSeconds(60)), new InternetExplorerOptions().ToCapabilities()) { } protected override void StartClient() { if (this.server == null) { this.server = new InternetExplorerDriverServer(); } if (this.server != null) { if (!InternetExplorerDriverServer.IsRunning) { this.server.Start(serverPort); } } } protected override void StopClient() { if (this.server != null) { this.server.Dispose(); } } }
  • 11. Lesson 3: Use Automation Atoms (but use them with care)http://vepca.files.wordpress.com/2011/10/gen-dynamics-tower.jpg
  • 12. Lesson 3: Use Automation Atoms(but use them with care) Consider the following HTML element: <input id=“my_button type=“button” onclick=“alert(‘hello, world’)” /> W h a t h a p p e n s if W e b E le m e n t . c lic k ( ) is u s in g a J a v a S c r ip t o n ly im p le m e n t a t io n ?
  • 13. Lesson 3: Use Automation Atoms(but use them with care) Consider the following HTML element: <form name=“my_form” action=“” onsubmit=“alert(‘hello, world’)” method=“post” /> W h a t h a p p e n s if W e b E le m e n t . s u b m it ( ) is u s in g a J a v a S c r ip t o n ly im p le m e n t a t io n ?
  • 14. Lesson 4: Use Native Events(for interacting with elements)
  • 15. Lesson 4: Use Native Events(for interacting with elements)
  • 16. Lesson 4: Use Native Events(for interacting with elements) Element with hovering menu Actions actions = new Actions(driver); actions .MoveToElement(element) .Perform(); Menu flashes and disappears
  • 17. Lesson 5: Log Everything (to preserve your sanity)http://cariferraro.com/wp-content/uploads/2012/02/MedievalScribe_JeanMielot.jpg
  • 18. Resources Initial email thread on Selenium Developers mailing list discussing IE driver rewrite: https://groups.google.com/d/topic/selenium-developers/TdYzD5e9IxI/discussion Follow-up email thread on Selenium Developers mailing list discussing status of IE driver rewrite: https://groups.google.com/d/topic/selenium-developers/oPmn0dBt4zU/discussion JSON Wire Protocol specification: http://code.google.com/p/selenium/wiki/JsonWireProtocol Automation Atoms description: http://code.google.com/p/selenium/wiki/AutomationAtoms