Friday, July 15, 2016

AUTOMATION 15 - GUI 3, introducing Selenium WebDriver

Technical level: **

Through some of these next few posts I'm going to flag up the technical level I believe I'm going to.  This is about 2/5.  I think everyone who is a tester and works with or alongside automation will benefit from.

So far we've looked at identifying page elements, and some very basic manipulation of page elements using Tamper Monkey.  This should be increasing our comfort and sense of "hands on" with the automation.

For the next few sections we'll be looking at Selenium WebDriver, and some tests we can do within this framework.  I'm hoping that by the end of this series you'll understand why we're focusing on Web Driver - over Selenium IDE, which is record and playback.

In a nutshell...

Driven by common computer languages

Selenium WebDriver is powered by a computer language - you can download it on multiple languages such as Java, C#, Ruby, Python.  In this series I'm focusing on Java.

We will also explore by series end why that's incredibly useful.

An API tool

Selenium WebDriver is an API tool - but it's somewhat different to the API's we've looked at previously.  It uses API commands to remote control your browser, and retrieve information from it.  In the examples we've looked at before, we used API commands to remote control part of your test system.  As such, testing with Selenium means we're testing with a complete system under test (your users browser is always external to your system).

Firefox out of the box, but other browsers are available

Out of the box, Selenium WebDriver works on Firefox.  You might be aware that Firefox is updated quite frequently, and likewise Selenium WebDriver has to be updated to keep pace.

In preparing an example, I was unable to get a very simple case to work - turns out my Firefox browser needed an update, and without it Selenium just wouldn't communicate!

Support for other browsers such as Chrome are available, including headless browsers.  Headless browsers such as PhantomJS don't have a graphical interface and return page information in pure html form.  This is really handy for an API driven system like Selenium, which doesn't really need that visual element.  It means if you run your automation with a headless browser, you can perform it much faster as it's stripped down to the bare minimum, such browsers work much faster than say Firefox.  Against that you're not able to screenshot when you have an issue.

I won't be going into any more detail about headless browsers, but if you're interested, you should do further reading.

Looking at Selenium, the commands available fall into several broad categories.  I believe it's useful for testers to be aware of these, even if they don't actually script it, because when you ask your automator to create automation for scenarios for you, you need to be work within these kinds of commands.

Page Manipulation

These kind of commands are a continuation of those we explored previously using TamperMonkey (although we use a different language here).

They are a set of commands to simulate us "doing" something to the page such as,

  • Entering test into a field
  • Selecting a radio button
  • Selecting/deselecting a checkbox
  • Choosing an option from a dropdown box
  • Pressing a button
Browser control

There are a host of controls which simulate some very basic commands, pretty much anything you can do with your controls in the top band of your browser there's a command for maximise/minimise, read the URL you're on, close/quit, go back.

One of the most useful functions is the navigate command, which takes your browser to the URL you provide.  This is obviously typically step 1 of most tests!

Capture web element

These kind of commands typically get Selenium to "locate" at an area of the web page, from details you provide (such as the ID we used last time).  

Once located, you can run checks on the content at that location - for instance you might open a page, and see if it ever makes a reference to the text "blue aardvark" for instance.

Explicit wait

After issuing a command using Selenium, you have to wait for the browser to respond.

When I was doing "old-style" automation back in 1999, we typically set a wait of about 2 seconds a command to cover this.  These days we want the script to run as fast as possible.

Selenium uses something called an explicit wait - it waits for an event to occur (which you define), it that happens, it will wait up to a time you determine, before moving on anyway.  [Trust me, you don't want to wait indefinitely]

Next time we'll look into installing everything you need for Selenium WebDriver, before moving on to some basic examples.

Extension material

I am using a host of material to prepare this section - primarily sourcing the WebDriver support pages here and here.  I've learned though such pages move around a lot, so be prepared to use Google for a search if this post is quite old.  Hopefully reading this series will help you get more out of those support pages, which I encourage you to visit and read as we work through some examples.

Engel Consulting runs a great course on Selenium WebDriver, and they have provided me support in putting together this series.

Ministry Of Testing has some a useful collection of videos with Richard Bradshaw, but they require membership - which although might seem expensive, talk to your company about (it's an on-demand learning resource, cheaper than sending on a course).


  1. I agree with your post. Selenium is most used automation tool to test web application and browser. This automation tool offers precise and complete information about a software application or environment. Selenium Training in Chennai

  2. I am following your blog from the beginning, it was so distinct & I had a chance to collect conglomeration of information that helps me a lot to improvise myself.
    testing training in chennai|Software training institutes in chennai

  3. Really awesome blog. Your blog is really useful for me. Thanks for sharing this informative blog. Keep update your blog. Selenium Training in Chennai

  4. really you have posted an informative blog it will be really helpful to many peoples. thank you for sharing this blog.
    selenium training in chennai

  5. Nicely explained. Here you described the well written article from your in-depth knowledge. Truly impressive and nice information

    Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

    Java Online Training Java Online Training JavaEE Training in Chennai Java EE Training in Chennai


  6. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Android Training in Chennai
    Ios Training in Chennai

  7. The blog gave me idea about selenium web driver My sincere thanks for sharing this post and please Countinue To share this kind of post
    Selenium Training in Chennai

  8. This article is so informatic and it really helped me to know more about the Selenium Testing. This selenium article helps the beginners to learn the best training course. So keep updating the content regularly.
    Selenium Training in Chennai | Best Selenium Training institute in Chennai | Selenium Course in Chennai

  9. really you have posted an informative blog. it will be really helpful to many peoples. so keep on sharing such kind of an interesting blogs. before i read this blog i didn't have any knowledge about this but now i got some knowledge.
    selenium training in chennai

  10. Hello Admin,
    I really enjoyed while reading your article, the information you have mentioned in this post was damn good. Keep sharing your blog with updated and useful information.

    Selenium Training in Bangalore

  11. This blog is very well good as i am working in selenium sector it is really useful for me. so please update latest kind of information too. Software Testing Training in Chennai | Salesforce Training in Chennai

  12. This comment has been removed by the author.

  13. This is an awesome post.Really very informative and creative contents.Thanks to sharing these concept is a good way to enhance my knowledge. I like this site very much.I like it and help me to develop my knowledge very well.Thank you for this brief explanation....
    Java Training in chennai |Python Training in Chennai|Best Python Training in Chennai

  14. hi admin.i am really love it your blog.Because your explanation wise all the topics are too good.I got enough knowledge from your blog.Thanks for sharing more..
    Software Testing Training in Bangalore
    Dot Net Training in Chennai

  15. Wonderful information on recent technology. Keep following my profile to know about

    the Software courses like Selenium testing.

    Selenium Training in Velachery |
    Selenium Course in Chennai

  16. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.
    Software Testing Training in Bangalore

    Software Testing Training in BTM Layout

    Software Testing Training in Marathahalli

  17. I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.

    selenium training in bangalore|

  18. Gclub Create a moment of fun, entertainment.

    G club Online casino site of the famous online gambling in Asia. Online casino gambling is considered to be one of the starting point and a good investment of the casino industry and for investing in online gambling games, the site is considered as a good investment for people with horoscopes and people who are. Betting Opportunities

    Playing online casino games with online casinos is considered an investment that is not wasted, because your investment will be able to grow and profit for you well. The online betting site is also a new way to make money and to pocket money just to play games online with us only. It is known that making money on the site of the online casino is easy and that you can easily access it as well.

    So if you are thinking about playing online gambling games, do not forget to check out our online casino site. Because fun and money are what you can set. Gclub มือถือ

  19. Nice blog has been shared by you. before i read this blog i didn't have any knowledge about this but now i got some knowledge so keep on sharing such kind of an interesting blogs.

    automation testing courses online

  20. Very Helpful Post And Explained Very Clearly About All the things.Very Helpful. Coming To Our Self We Provide Food Service Parts Through Out US At Very Affordable Prices And Also We Offer Same Day Shipping In US.We Offer Only Genuine Products.Really Thanks For Posting Such an useful Content.

  21. Really It's A Great Pleasure reading your Article,learned a lot of new things,we have to keep on updating it,Primary Care Chicago .By getting them into one place.Really thanks for posting.Very Thankful for the Informative Post.Really Thanks For Posting.

  22. It is exceptionally valuable data. It will enhance my insight in Selenium. Much thanks to you for sharing this marvelous site.
    Selenium training Chennai | Selenium testing training in Chennai | Best selenium training in Chennai | Selenium classes in Chennai

  23. It's A Great Pleasure reading your Article, learned a lot of new things, we have to keep on updating it Bala Guntipalli Thanks for posting.

  24. Thank you for sharing beneficial information nice post USMLE

  25. Thanks for sharing the valuable information to share with us For more valuable information please visit our website.

    selenium training in chennai

    aws training in chennai

  26. Really Tanks For Sharing Such an Important Post...

    Vizag Real Estate

  27.      Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.

    ccna training in chennai

    ccna training in bangalore

    ccna training in pune

  28. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    java training in chennai | java training in bangalore

    java training in tambaram | java training in velachery

    java training in omr

  29. I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful.
    Selenium Training Chennai
    software testing selenium training
    selenium testing training in chennai
    Best selenium training in chennai

  30. Thank you for allowing me to read it, welcome to the next in a recent article. And thanks for sharing the nice article, keep posting or updating news article.
    python online training
    python training in OMR
    python training course in chennai

  31. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
    Devops training in sholinganallur
    Devops training in velachery
    Devops training in annanagar
    Devops training in tambaram

  32. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.

    rpa interview questions and answers
    automation anywhere interview questions and answers
    blueprism interview questions and answers
    uipath interview questions and answers
    rpa training in chennai

  33. I enjoy what you guys are usually up too. This sort of clever work and coverage! Keep up the wonderful works guys I’ve added you guys to my blog roll.
    best safety course in chennai

  34. Good job in presenting the correct content with the clear explanation. The content looks real with valid information. Good Work

    DevOps is currently a popular model currently organizations all over the world moving towards to it. Your post gave a clear idea about knowing the DevOps model and its importance.

    Good to learn about DevOps at this time.

    devops training in chennai | devops training in chennai with placement | devops training in chennai omr | devops training in velachery | devops training in chennai tambaram | devops institutes in chennai | devops certification in chennai | trending technologies list 2018

  35. Nice Post. Looking for more updates from you. Thanks for sharing.

    Guest posting sites

  36. I want to thank you for this great blog! I really enjoying every little bit of it and I have you bookmarked to check out new stuff you post.
    website designing training
    web designing training
    web designing in chennai
    PHP Training in Chennai
    PHP Course in Chennai
    PHP Training Institute in Chennai

  37. Wonderful blog!!! Thanks for your information… Waiting for your upcoming data.


  38. This information is impressive; I am inspired with your post. Keep posting like this, This is very useful.Thank you so much. Waiting for more blogs like this.
    airport ground staff training courses in chennai
    airport ground staff training in chennai
    ground staff training in chennai

  39. Thanks you for sharing this unique useful information content with us. Really awesome work. keep on blogging
    apple service center | apple iphone service center | apple ipad service center | apple mac service center

  40. Some us know all relating to the compelling medium you present powerful steps on this blog and therefore strongly encourage contribution from other ones on this subject while our own child is truly discovering a great deal. Have fun with the remaining portion of the year.
    iosh safety course in chennai


  41. You are doing a great job. I would like to appreciate your work for good accuracy
    Data Science Course in Chennai | Data Science Training Institute

  42. Very nice post here thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
    machine learning training in chennai
    best training insitute for machine learning
    machine learning course in Chennai

  43. Thank you for sharing your article. Great efforts put it to find the list of articles which is very useful to know, Definitely will share the same to other forums.

    best openstack training in chennai | openstack course fees in chennai | openstack certification in chennai | openstack training in chennai velachery

  44. Thanks For sharing Your information The Information Shared Is Very Valuable Please Keep updating Us Time Just Went On Redaing The Article Python Online Course Devops Online Course Data Science Online Course Aws Science Online Course

  45. This is best one article so far I have read online, I would like to appreciate you for making it very simple and easy
    Devops Training in Chennai | Devops Certification in Chennai

  46. Nice article i was really impressed by seeing this article, it was very interesting and it is very useful for me.I get a lot of great information from this blog. Thank you for your sharing this informative blog.
    Devops Training in Chennai | Devops Training Institute in Chennai

  47. I wish to say that this post is amazing, nice written and include approximately all important infos. I would like to see more posts like this
    Python Training in Chennai | Python Programming Classes | Python Classes in Chennai

  48. Thanks for sharing this information admin, it helps me to learn new things. Continue sharing more like this.
    Tableau training in Chennai | Tableau Courses Training in Chennai | Tableau training Institute in Chennai

  49. You Are doing a great job. I would like to appreciate your work for good accuracy
    R Language Training in Chennai

  50. Amazing article. Your blog helped me to improve myself in many ways thanks for sharing this kind of wonderful informative blogs in live. I have bookmarked more article from this website. Such a nice blog you are providing ! Kindly Visit Us @ Best Travels in Madurai | Tours and Travels in Madurai | Madurai Travels

  51. Great post! This is very useful for me and gain more information, Thanks for sharing with us.


  52. Interesting information and attractive.This blog is really rocking... Yes, the post is very interesting and I really like it.I never seen articles like this. I meant it's so knowledgeable, informative, and good looking site. I appreciate your hard work. Good job.
    Kindly visit us @
    Sathya Online Shopping
    Online AC Price | Air Conditioner Online | AC Offers Online | AC Online Shopping
    Inverter AC | Best Inverter AC | Inverter Split AC
    Buy Split AC Online | Best Split AC | Split AC Online
    LED TV Sale | Buy LED TV Online | Smart LED TV | LED TV Price
    Laptop Price | Laptops for Sale | Buy Laptop | Buy Laptop Online
    Full HD TV Price | LED HD TV Price
    Buy Ultra HD TV | Buy Ultra HD TV Online
    Buy Mobile Online | Buy Smartphone Online in India

  53. This is really great work. Thank you for sharing such a good and useful information here in the blog for students.
    Kindly visit us @
    SATHYA Technosoft (I) PVT LTD
    Social Media Marketing Company in India
    SEO Company India
    PPC Services in India

  54. Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
    IT Institute in KK Nagar| Data Science Training in chennai | data science course in chennai | data science Training Institute in Chennai