Tuesday, August 16, 2016

AUTOMATION 23 - GUI 10, Switching to Chrome

Technical difficulty: ****

Last week I reported on the recent changes to Selenium WebDriver.  Specifically they impacted using Firefox out-of-the-box, meaning you needed to download an position a new driver to make it work.

I was hoping it'd be all sorted by today - but alas no.  Although generally good, I'm getting issues on some basics - to confirm it's the new Gecko driver, I've tried running on Chrome, and found the issues vanish.

Update Selenium WebDriver in your project area

Switching to Chrome is relatively easy - but first we need to update our version of WebDriver used in our project.  Start with downloading the latest version of Selenium Webdriver here, and extracting it to somewhere on your system (remember where).

Under Eclipse, I've gone into my project gone Build Path -> Configure Build Path

There I've removed the previous .jar files for the last Selenium WebDriver build I've done, and then used Add External Jars to add back in all the new ones.

Put the browser driver into place

The Google Chrome driver (and indeed the Gecko driver) are a form of middleware which acts between the software of the Selenium WebDriver and the browser itself.  You'll sometimes hear the word "marionette" used to describe it, because this software essentially "pulls the strings" on your target browser.

Now, you need to download the Google Chrome Driver from here,

Now a little more tricky - to make this work it needs to be copied into your project workspace, for me it goes ...

You might notice I've also placed a version of the Firefox Gecko driver there as well.

Change your code

This is really simple - first off in your header you need to include the following,

    import org.openqa.selenium.chrome.ChromeDriver;

This includes the objects and methods needed for the ChromeDriver.  You then change your declaration of,

    WebDriver driver = new FirefoxDriver();

To ...

    WebDriver driver = new ChromeDriver();

That's pretty much it.  Although in reality there can be oddities thrown out by a change of browser - I found mine regarding the selection of frame which contains "Enter your comment".  I modified my code to use an algorithm which looked through all the frames on the page, selecting the one which says "Enter your comment" ...

I've already committed these changes to my Github page - find me there.  Really it's the second project which has had the most revision to include that frame search, which is here.


  1. This comment has been removed by a blog administrator.

  2. I am glad to see this post on your website. It is beneficial for us and can be very useful in our daily life, and we always use your website information and experiences. Anyway, thank you so much.
    digital marketing services in india

  3. Nutra Trials defines personal characteristics of different health products including skincare, weight loss, muscle and male enhancement. The study presented here is briefly described for reader convenience and to deliver them assurance with health standards. The best possible answers are given here regarding the selection of an ideal supplement or cream or serum that possibly remains to be safe for health and do not cause any side effects.

  4. It is a great job, I like your posts and wish you all the best. and I hope you continue this job well.
    NutraT line

  5. Enduro stack Testosterone Booster is much safer than taking steroids or random supplements from the drugstore. Because, those supplements aren’t quality controlled or checked for safety, unlike this one. And, the majority of these products rely on artificial ingredients, fillers, and binders. Overtime, artificial ingredients can harm your body by building up toxins in it. Now, you can avoid that situation altogether with Enduro stack. Because, this supplement is completely natural, and it boosts testosterone the safe way. So, you can finally get results without worrying about hurting your body. Click below to order your own Enduro stack free trial!
    Enduro Stack

  6. Hello, I am thomus jons thank you for this informative post. That is a great job. Wish you more success.Thank you so much and for you all the best. Takes Down

  7. TecSmash is your ultimate source of Technology news and Make Money Online product reviews. We research and review all Tech, MMO, Biz Opp and IM products.

  8. Best softwares for Internet Marketers and legitimate make money online opportunities.

  9. Here is our FB SociCake Review, in which I have revealed the good, bad and ugly about Mario Browns FB SociCake Facebook Marketing Tool. socicake review

  10. We are here to give you a complete review on the Parallel Profit project by Steve Clayton and Aidan Booth. If you are someone from the field you would already be familiar with these two names, for those of who are new. Parallel Profits Review

  11. Best softwares for Internet Marketers and legitimate make money online opportunities.

  12. WiredReach.org is dedicated to bring you the best in Internet Marketing, Blogging and the entire Make Money Online spectrum. We are your finest source of info.

  13. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work…
    Weight loss foods

  14. Quit 9 To 5 Academy Review is an amazing website where you get to work and learn with the professionals and then start your business in the platform of Facebook.

  15. Eat Stop Eat Book program was one of the foremost and is not actually counted as one of the fads. It is your crucial guide but using the latest science for intermittent fasting to attain simple yet effective weight loss results.

  16. The Probiotic supplement helps to balance good bacteria and in this regard, Probiotic t-50 review is creating buzz. How far is the supplement reliable and worth considering, you will come to know about it here.

  17. Don't Waste Time! 5 Facts Until You Reach Your Adtrics Academy - https://www.reviewengin.com/adtrics-academy-review/

  18. Keto Ignite Diet is one of the best dietary supplements that is dedicated to shed pounds and drive instant weight loss reduction naturally. It is a dual action appetite suppressant that works on the ketosis process and controls the carbohydrate conversion to fat structure and drives energy and strength level. Kindly Visit on http://www.rushyourtrial.com/coupon/keto-ignite-reviews-ketosis-weight-loss-pills/

  19. Keto Buzz is a weight reduction formula which is used by a variety of different customer for the different desires. This supplement has the capacity to enable ketosis in your system, due to which you will be able to reduce fat faster. In addition to this, it also promotes other health benefits, making you less prone to heart risk, and cholesterol diseases. Visit On http://www.powerenrich.com/keto-buzz-weight-loss-supplement-reviews/