December 22, 2015

Automate Amazon: Development Environment Setup

This post is first in a series of nine.

Back in June 2015, I blogged about how I would write automated tests vs Dave Haeffner's site, "The-Internet".

For this second project, I picked a more difficult site to automate: Puchasing an order on Amazon.com's site.



Please note: I haven't been doing automation on-the-job for very long. I have less than a year's worth of experience developing automated tests in Selenium WebDriver. Please don't take anything that I am doing as the industry standard.


If you do have knowledge of the industry standard of automated testing, please feel free to correct me! I will be eagerly monitoring the comments section for any advice or wisdom.

Setting Up the Development Environment


For this project I am using:
  • Platform and Operating System: Windows 10.
  • Integrated Development Environment (IDE): IntelliJ. Although we use the Enterprise Edition at work, the only difference between that and the free Community version is extra features for database integration.  
  • Test Framework: TestNG. It is built into the latest version of IntelliJ, but you still need to set up the dependencies in your pom.xml file.
  • Dependencies Management: Even though at work we use Gradle, for this project I am using Maven to add Selenium WebDriver and TestNG as dependencies. 
  • Browsers: Both at work and at home to inspect page elements, I use the Firefox browser plugins Firebug and Firepath to examine the web document.

If you need help getting IntelliJ, setting up Maven, setting up your pom.xml file or TestNG, or installing Firefox, Firebug or Firepath, there is a free introduction on Alan Richardson's page, Start Using Selenium WebDriver at http://seleniumsimplified.com/get-started/.

If you are looking for more material, Alan Richardson has an extensive course on Selenium 2 WebDriver with Java at http://courses.compendiumdev.co.uk/courses/selenium-2-webdriver-with-java which helped me immensely preparing for my current position.

Make sure to go to the official SeleniumHQ site at http://docs.seleniumhq.org/docs/ or visit their new documentation that is still in progress at https://seleniumhq.github.io/docs/.

If it helps, below is a sample of my POM.xml file.

<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0"         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.tjmaher.selenium</groupId>
    <artifactId>com.tjmaher.selenium</artifactId>
    <version>1.0-SNAPSHOT</version>
    <dependencies>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.48.2</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.1.1</version>
        </dependency>
    </dependencies>

</project>



Run Your First Test

Let's name the test class PurchaseOrderTest.java.

The @BeforeClass method contains the setUp information that launches the browser.
The @AfterClass method contains the tearDown information that closes the browser.

They will be executed respectively before the class PurchaseOrderTest, then after the class is done.





When you run PurchaseOrderTest:

  • The Firefox browser opens up
  • It navigates to Amazon.com
  • The Firefox browser closes.



Now that we know that tests can be run, with the next installment of this blog, we can sketch out a quick test.

-T.J. Maher
 Sr. QA Engineer, Fitbit
 Boston, MA

// Automated tester for [ 8 ] month and counting!

Please note: 'Adventures in Automation' is a personal blog about automated testing. It is not an official blog of Fitbit.com



29 comments:

Roger Arin said...

Thanks for sharing this post and the efforts you have made in writing this. Good to see such nice articulated post!!
Thanks for sharing this blog!!
nh623m paint gallon

Isabell Kiral said...

This platform is very much beneficial for us because through this, we can earn a lot of money by doing work from home. Many professionals have joined this field and they are satisfied. Assignment writing services.

Rian said...

event marketing a generation of professional online content creators on these platforms have largely already cracked the code on delivering sponsor ROI to an audience trained to bypass any advertising they can opt out of good morning prayer, ice puns and cow puns.

oncasinosite said...

Hey there. I found your site by the use of Google whilst looking for a similar subject, your site came up. It looks good. I have bookmarked it in my google bookmarks to visit then. Also visit my website: 온라인카지노사이트

casinositelink said...

It is perfect time to make some plans for the future and it is time to be happy. I have read this post and if I could I want to suggest you some interesting things or advice. Maybe you can write next articles referring to this article. I want to read even more things about it Also visit my website: 카지노사이트링크

oncasinositenet said...

it’s really a nice and useful piece of information. I’m happy that you simply shared this helpful information with us. Please keep us informed like this. Thank you for sharing. Also visit my website: 온라인카지노사이트넷

bacarasite said...

This is my first time i visit here. 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 Also visit my website: 바카라사이트닷컴

Anonymous said...

I must admit that your post is really interesting. I have spent a lot of my spare time reading your content. Thank you a lot! click here

vé máy bay từ canada về việt nam said...

Mua vé tại đại lý vé máy bay Aivivu, tham khảo

gia ve may bay di my

chuyến bay từ mỹ về việt nam tháng 1/2021

đăng ký bay từ canada về Việt Nam

mua vé từ nhật về việt nam

giá vé máy bay từ hàn quốc về việt nam

Vé máy bay từ Đài Loan về VN

Chuyen bay cho chuyen gia nuoc ngoai

Ina said...

Writing a management assignment requests a lot of time and exertion, taking out which isn't each student's favorite thing in the world as using time effectively is likewise an ability that can't be mastered for the time being. On the off chance that you're wrestling with time requirements, and need our management assignment help specialists to deal with your load of writing undertakings, then, then, enlist them today and see with your own eyes how ponders they can help your academic career. visit - my assignment help

baccarat said...

What a nice post! I'm so happy to read this. baccarat What you wrote was very helpful to me. Thank you. Actually, I run a site similar to you. If you have time, could you visit my site? Please leave your comments after reading what I wrote. If you do so, I will actively reflect your opinion. I think it will be a great help to run my site. Have a good day.


John Smith said...

Very useful Post. I found so many interesting stuff in your Blog especially its discussion. Multiple Daily Doses Section

Multiple Daily Doses Section

Trienviro 360 Business Solution Pvt. Ltd said...

Professionally written blogs are rare to find, however, I appreciate all the points mentioned here. I also want to include some other writing skills which everyone must be aware of.Website Design and Development Company

sifon said...

Thank you for sharing this informative blog post. it's amazing. Looking forward for more post. ican business law past question pdf

zarkazijar said...

Great blog I love this article for its well-researched content and excellent presentation. I fell in love with this material and couldn't stop reading. I am impressed with your work and skills. Thanks for sharing. free school of nursing past questionsvisit Best Rated Educational Update Portal in the World; Examination and Academic Guide, High Paying Jobs & Scholarship  Website.

Anonymous said...

you are very sincere and hardworking. nice try. immigration past questions in pdf free download

Anonymous said...

Nice, this is one of the best content where there is lots of gaining information is available. Also if looking for accounting assignment help then get it done with ous where you will get plagrisum free content guarantee with on time delivery. Also our experts are available for you 24*7.

Email Marketing Companies In Delhi NCR said...

Your blog provided us useful information to work on. You have done a extraordinary job!
Bulk Email Marketing Delhi
Email Marketing Services In Delhi NCR

Tara said...

Thank you for the wonderful blog.
I enjoyed reading your content. Keep doing your best work.Washington County Reckless Driving

johnnydepp said...

very nice article. Reckless Driving Dinwiddie VA Lawyer

Teslin said...

Nice interesting blog. Keep posting more good blogs. Lawyer for Tax Fraud

Anonymous said...

An interesting and well-written post. Keep up the interesting blog postings.criminal attorneys in prince william county

Mason Dale said...

Exciting to see the steps towards automating Amazon processes! As the retail landscape continues to evolve, the concept of an Amazon Automation Store becomes increasingly intriguing. Establishing a development environment lays the foundation for innovative automation solutions that can streamline operations, enhance efficiency, and redefine the shopping experience. Looking forward to seeing the progress and potential impact of Amazon automation initiatives!

Tara said...

"Explore the cutting-edge world of Amazon automation with our insightful blog! Unlock the secrets of streamlining processes, optimizing workflows, and maximizing profits using innovative development techniques. From AI-driven solutions to advanced algorithms, join us on a journey to revolutionize your Amazon business and stay ahead in the digital marketplace."traffic lawyer manassas va






Anonymous said...

In Virginia, there are several different offenses related to careless driving, including as racing, going too fast, not yielding enough space, passing illegally, and driving with malfunctioning brakes. Serious criminal charges and penalties may follow these actions.
what constitutes reckless driving in virginia

Robin Smith said...

Impressive, best content with a wealth of knowledge available. And if you need assignment assistance, contact us and we will provide you with plagiarism-free work and on-time delivery for accounting assignment help. Additionally, our professionals are available 24 hours a day, seven days a week.

Anonymous said...

This means that a reckless driving conviction could be reported to the driver’s home state, potentially resulting in points on their driving record and higher insurance rates.virginia reckless driving out of state license

CharlesBannerman said...

Public safety issues are raised by Virginia Beach's use of undercover police to carry out prostitution stings in an effort to prevent human trafficking and illicit sex work.
virginia beach prostitution sting

Kiefer Auctioneers said...

Texas online auctions offer an exciting platform for buyers and sellers to connect, providing access to a wide variety of items, including vehicles, equipment, collectibles, and real estate. These auctions combine convenience with competitive bidding, allowing participants to browse and bid from anywhere. Popular platforms cater to government surplus, estate sales, and private sellers, offering unique deals and rare finds.

Buyers benefit from transparency, as item descriptions, photos, and details are readily available. Sellers gain access to a broad audience, increasing the likelihood of quick sales. Whether you're hunting for bargains or selling unwanted assets, online auctions Texas provide a fast, efficient, and cost-effective solution in the digital marketplace.