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

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

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

1,252

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,252
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
23
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

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

×