23

I want to learn Selenium, but I don't know what to code. Sure, I can throw Google some queries, I can fill out some forms, press buttons, find divs and links, etc. But I think this stuff is pretty basic.

What would be more "advanced" ideas to try out? Can you give real-life examples?

1
  • How about automating an end to end scenario of your application under test?No matter how complex scenario you pick up ultimately you will be filling data and pressing buttons only using webdriver because this is what is meant to do. Jan 2, 2018 at 10:13

13 Answers 13

23

For hacking WebDriver without real production purpose, you need to find some task that really motivates you.

Don’t forget, WebDriver – is not only about test automation, people use the tool (not so widely) for many different purposes: crawling some data from websites, semi-automating real job-related tasks.

For instance, a girlfriend of friend of mine is working for real-estate agency. The part of her job was to update actual ads. She has to find all ads belong to her account, and re-save each on multiple different web-sites.
My friend wrote a Console application with C# and WebDriver which automates those actions:

Login to website
For each page in the account:
Open and resave each ad on the page.

When I mentoring new person whom is willing to learn test automation, I give him/her a task to write a program which gathers the trains information (availability and ticket prize) on the Ukrainian Railways website.
http://booking.uz.gov.ua/en/
They have really tricky undocumented prizing; which depends on the days of the week and the amount of time before the departure.
The program should log information about all available trains on the time when it started.

An Airlines Company website is also a good option. You can try this one. It is complicated enough: http://www.lufthansa.com/online/portal/lh/ua/homepage

And you can also write a console application which sends new messages to twitter. Of course, it should support image attachments. That could be a good candidate to post on Hacker News.
I haven’t heard someone had done something like that before.

3
  • +1 for using Selenium to automate everyday tasks. When learning Selenium I did something similar, to automate compiling my daily work reports (how many ours spent on what) in our internal Web app. Filling up data manually was boring and the app required too many clicks, so I used Excel to define data to enter.
    – dzieciou
    Apr 27, 2014 at 16:13
  • 2
    -1 For using production sites without permission Jun 13, 2016 at 22:50
  • 1
    0 What is the problem MichaelDurrant ? Just get the permission from the site owner before you are about to automate the site. I shouldn't be doing this for you... or should I? Jun 15, 2016 at 5:57
12

You should never run automated tests against a website for which you don't have permission. The site owner could consider it a denial of service attack or an attempt at hacking. In theory, they could sue you or ask your ISP to drop you. If you do this using a company computer, you could put your company in jeopardy. Don't do it.

Here are three sites designed for people to test. I talk about them at "Free Sites For Practicing Your Web Testing" ( http://www.allthingsquality.com/2011/11/sites-for-practicing-your-web-testing.html )

ParkCalc Widget http://adam.goucher.ca/parkcalc/

Brown & Donaldson (B&D) online brokerage Web site http://bdonline.sqe.com/

The Mercury Tours Web Site http://newtours.demoaut.com/

Another alternative is to build your own web site, using whatever tools you have at your disposal. I've done something similar to create non-web applications for people to test:

Triangle Test #1 http://www.allthingsquality.com/2009/01/wintask-triangle-test.html

Triangle Test #2 http://www.allthingsquality.com/2009/01/wintask-triangle-test-2.html

Hello World Test http://www.allthingsquality.com/2009/02/wintask-hello-world-test.html

7
  • 2
    Why should I request permission to run tests on a website? What's the difference between this and clicking many times on their pages? Dec 16, 2013 at 2:35
  • 1
    @I19 - The difference is a human using their site versus a tool. Websites are designed for business purposes, not for your testing pleasure. Dec 16, 2013 at 12:41
  • 3
    Aren't Web crawlers for search engines doing the same? And then Deep Web crawlers crawling data through Web forms?
    – dzieciou
    Apr 27, 2014 at 16:18
  • 1
    @dzieciou - perhaps, but so what? When analyzing web logs, it's pretty easy to determine if the hits are coming from web crawlers or not. You aren't a web crawler, thus you are at risk of being put on a black list. Apr 27, 2014 at 16:37
  • 1
    @JoeStrazzere. Right, but what makes my automate different from Web crawler? This is an interesting topic, but I agree it seems completely off-topic here, so I moved my quest to programmers.stackexchange.com/questions/237183/…
    – dzieciou
    Apr 27, 2014 at 20:25
8

'Welcome to the Internet' provides a ton of good real world examples that you can use to write some test automation code against.

http://the-internet.herokuapp.com/

4

Here is a simple test scenario that should still prove educational:

  1. Log in to your webmail provider.
  2. Send yourself an email.
  3. Verify that the email was received.
  4. Delete the email.
  5. Log out of the email provider.
3

A very good exercise is to practice on a real project. I advice you opensource projects. It allows you to practice and to contribute to the community reporting bugs.

Personally I am practicing on OpenClinica (https://www.openclinica.com). You can start doing easy tests until more complex one.

3

You can also use "ActiTime" application (http://www.actitime.com/). You can use this application without internet (Without internet this application will work as an web-based application).

2

To gain some experience on Selenium, I installed Jenkins locally and tried to write some scripts through the different screens of the product. I found it a good choice because I could work without a network connexion (install is local, I don't rely on external web site) and when I wanted to show my work or ask for help, the people I would show my work to were familiar with the SUT (because we all use Jenkins down here).

1
1

Try www.onlinestore.toolsqa.com to practice automation. It is a Ecommerce website specially built up for Automation testers, place free order and recieve emails confirmation, add to cart, product details , product listings , you can extend your test.

Plus it is a responsive website so mobile automation is also possible.

Selenium Automation Framework is also given for the beginners based on the same application to learn and practice on www.toolsqa.com.

Regards, ToolsQA

2
  • Your site is very good. Well Structured code with examples on selenium Automation. Welcome to SQA Again!
    – Siva
    Jun 4, 2014 at 17:17
  • 1
    The URL has changed. The correct URL for the online store is now store.demoqa.com
    – Frank H.
    Apr 28, 2015 at 12:52
1

If you want to start with selenium ,I would mention some points what i followed during my initial learning of Selenium.

  1. First of all start learning any of the programming language concepts (i learned Java).
  2. Using Selenium IDE start finding the elements of web pages.
  3. Then try to make small scenarios for a particular functionality.
  4. Then try coding with Selenium WebDriver.

  5. As you feel comfortable with small scenarios , try to code some complex scenarios.

Best Luck

1

There is one more site which includes HTML modules as well as Angular JS modules. There you can practice Selenium with different modules and can cover every aspect of automation.

http://www.globalsqa.com/demo-site/ http://www.globalsqa.com/angularjs-protractor-practice-site/

0

Rather than looking for sites to practice on, one thing that I've found useful is if you yourself, or with the help of class-mates, work-mates, build one to test with. This allows you to kind of design your own curriculum as far as learning about the driver and attached frameworks, but, can also give you a good insight into better design patterns and improve your other testing skills.

1
  • I like this answer less because if a single person both writes and tests the page, you will make it very easy to test - unique 'id' attributes on all the useful elements, for example. A lot of the more interesting functionality and learning can only be done on a page where everything isn't "just right".
    – Bruce
    Dec 14, 2013 at 0:26
0

ToolsQA is awesome. Please have a look and do go step by step. You will learn quite a bit.

1
  • Why is Tools QA a good site to try to test with Selenium a good site? its more about Selenium resources, did you read the question correcty? Jun 11, 2015 at 8:41
0

As suggested by R-R, toolsQA is good website to start selenium from beginning. Here are the Demo website list specially designed to learn selenium automation with your preferred language, all the available option to work with textbox, list, dropdown list, radio/check box, and many more.

Not the answer you're looking for? Browse other questions tagged or ask your own question.