Science of Selenium
eBook - ePub

Science of Selenium

Master Web UI Automation and Create Your Own Test Automation Framework

Kalilur Rahman

Share book
  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

Science of Selenium

Master Web UI Automation and Create Your Own Test Automation Framework

Kalilur Rahman

Book details
Book preview
Table of contents
Citations

About This Book

Step-by-step guide to understand key concepts for Selenium Automation using examples to shine in your interview for test automation roles Key Features

  • Acquire Selenium skills to do independent test automation projects
  • Learn the basics of Selenium Web Driver for test automation using Selenium
  • Understand Page Object Model, including how and when they're used in test automation
  • Understand the approach for building a test automation framework
  • Build Selenium test automation scripts using various languages – Java, Python, JavaScript/Node JS and Ruby
  • Learn how to report and integrate with CI tools for test automation
  • Get some professional tips for handing interviews and test automation approach
  • Implement cross-browser testing scenarios using Selenium Grid and commercial tools and services

  • Description
    Software Engineering has taken massive strides with a multitude of technology innovations. With several changes being introduced – development of products and their integration into the market – understanding of mobile devices and user interface channels across a plethora of platforms is getting complex day by day. In addition, since the process or procedures of software testing for products and applications can become an act of boiling the ocean, the role of test automation is crucial while dealing with such challenges. The book starts with a brief introduction to the world of automation and why it is important, succinctly covering the history of Selenium and the capabilities it offers. In this book, you will learn how to do simple Selenium-based automation with examples and understand progressive complexity of some key features. Before diving deep into advanced concepts such as Page Object Models, Test Automation Framework and Cross Browser testing, you will grasp comprehensive knowledge of several concepts related to Java, Python, JavaScript and Ruby programming languages. What you will learn
    By the end of the book, you will find several examples to help ignite your understanding and usage of Selenium across a myriad of languages and frameworks. With this, you'll be able to put your knowledge to practice and solve real-life test automation challenges such as testing a web site, mobile application and leveraging tools available for fast-tracking your test automation approach. Who this book is for
    The book is intended for anyone looking to make a career in test automation using Selenium, all aspiring manual testers who want to learn the most powerful test automation framework – Selenium and associated programming languages – or working professionals who want to switch their career to testing. Table of Contents
    1. Introduction to Test Automation
    2. Introduction to Selenium
    3. Understanding Selenium Architecture
    4. Understanding Selenium Tools
    5. Understanding Web UI
    6. Web UI Automation with Selenium Using Java & Python
    7. Selenium Coding with Other Languages – Ruby & JavaScript
    8. Building a Test Automation Framework with Selenium
    9. Advanced Features of Selenium Using Java & Python
    10. Cross-Browser Test Automation
    11. Tips and Tricks for Test Automation
    12. Interview Tips About the Author
    Kalilur Rahman has a Master's Degree in Business Administration preceded by an Engineering Degree in Computer Science and over 2 decades of experience in software development, testing and management consultancy. Kalilur has been a developer, designer, technical architect, test program manager, delivery unit head, IT Services and Factory Services Head of varying complexity across telecommunications, life sciences, retail and healthcare industries. His LinkedIn Profile: https://www.linkedin.com/in/kalilurrahman/

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Science of Selenium an online PDF/ePUB?
Yes, you can access Science of Selenium by Kalilur Rahman in PDF and/or ePUB format, as well as other popular books in Informatik & Qualitätssicherung & Prüfung. We have over one million books available in our catalogue for you to explore.

Information

Year
2019
ISBN
9789389423242

CHAPTER 1

Introduction to Test Automation

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”
—Brian W. Kernighan
(Inventor of UNIX Operating System & Author of “The C Programming Language”)
Automation has been a productivity enhancer for humankind. With the advent of exponential growth in technology, how can we automate testing of the millions of lines of code churned every hour? This is where test automation plays a vital role – automating the testing of the automation tools to enhance the productivity of humankind. Test automation will be an essential part of the productivity growth of humanity. Without test automation, the release of quality code to production will become an activity equivalent to boiling an ocean. To do good quality product development, one should understand the importance of testing. To do rapid, efficient and productive testing, one should understand the importance of test automation. This chapter focuses on why test automation is very important. For a good test automation engineer, the fundamentals of test automation are must-have. He or she ought to know why, which, when and how test automation is essential. This chapter covers an introduction to why do we need test automation, what are the methods and tools we can leverage, when to do with test automation and how to get on with it. If a test automation engineer is thorough with these fundamentals, then the interview will be a smooth ride. This chapter describes key aspects of test automation that would be useful.

Structure

  • What is automation?
  • Introduction to test automation
  • Benefits of test automation
  • History of test automation
  • Generations of test automation and evolution
  • Introduction to different types of test automation
  • Test automation framework
  • What tests to automate
  • Test automation challenges
  • Test Automation Interview – Q & A

Objective

After studying this chapter, you should be able to understand some of the key interview questions to answer such as – Why test automation is important. What are the key drivers for test automation? Why should we automate at all? What are the hurdles faced whilst doing test automation? What are the tools available? What are the benefits of test automation? What are the skills needed by the test automation engineers? What is the history of test automation? What are some techniques and frameworks used for test automation? What are some of the challenges to overcome?

What is automation?

The definition of “Automation” as per Wikipedia is “Automation is the technology by which a process or procedure is performed with minimal human assistance.” Any process or an activity done by a human in a repetitive manner involving motor or cognitive functions is a candidate for automation. From time immemorial, automation propelled every industrial revolution. On the other hand, the success of the industrial revolution was automation. Mechanical automation drove the first industrial revolution, with mechanical engines improving productivity such as steam engines and the use of tools for agricultural and mining production. The automation of mobility with the invention of wheel by Sumerians helped humans to become more agile. The automation of the printing process by Gutenberg helped propel the dissemination of knowledge in a rapid manner. The invention of the steam engine by James Watt and the first industrial train (“The Rocket”) by George Stephenson helped propel the movement of goods in a faster manner during the industrial revolution of the 19th Century. Other automation processes such as telegraph, telephony helped humans communicate better and efficiently. The automation of manufacturing with the assembly line process introduced by Henry Ford for Model-T car paved way for producing good, rapid and cheaper motorcars. The use of robotics with a focus on concepts of quality management like just in time, Kanban etc., helped produce products with precision and consistency and good quality. Thus, automation of production and assembly line aided by the electricity, just in time assembly and other innovations helped the second industrial revolution. The third industrial revolution is all about automation through computer systems. The advances in electronics, identification of transistors, chips and rapid processors helped humans automate and fast track computing, thereby propelling all of the industries to leapfrog. Finally, the fourth industrial revolution is all about the use of AI, robotics and other means to automate the automation process itself. Hence, automation has been and will be critical in the evolution of humankind.

Introduction to test automation

The question then arises, how to automate the testing and verification of systems. Can we boil the ocean with millions of testers spending months to rollout a feature or a product? It will be like the 15th century. How can we change that? Automating the testing process and use of efficient testing techniques will help achieve rapid, high quality testing at a cheaper rate through continuous testing and delivery. For instance, this will be like Amazon and other technology leaders releasing code to production in a matter of seconds to minutes and not in years.
Software Test Automation is a software, code or a process built using a software or a programming language to test a software or application under test to validate tests. This helps in validating checks against expected results and actual results attained by running the automation scripts/software. Test Automation software focuses primarily on automating the repetitive, monotonous and manual tasks. Some of the advanced test automation software could fully automate validation of end-to-end process flows of a software application. Software Test Automation can be leveraged across SDLC phases – right from Unit Testing (when the code is written initially) – to production deployment (where the deployed code can be checked for working functionality). Test automation can also be carried out at various layers, such as Graphical User Layer, Application Programming Interface (API) Layer and at the database layer, to validate functionalities, interfaces to ensure the application software under development meets the requirements.
Software Test Automation has been around ever since mainframe computers became a common enterprise automation tool. Even mainframes used Restructured Extended Executor (ReXX), JCL and other tools for automation of the testing process, resulting in productivity improvements. For client-server and GUI applications (with Windows/Mac revolution), it started with a simple codeless record and playback moving towards a code-driven test automation. With the players such as Mercury (which has since become Micro Focus tool after an interim stint with HP), Segue offering leading automation tools of the time, test automation was widely pursued as a means to fast-track testing, reduce cycle times and improve product quality by delivering business value faster. All these resulted in the rapid growth of the software industry.

Benefits of test automation

Some of the benefits of test automation include reduction of time and errors, avoiding repeatability, ability to execute testing around the clock in multiple systems and platforms, and ability to test same functionality with different or multiple data set, platforms at the same time. With the advent of DevOps and continuous integration, test automation has removed the need for manual touchpoints and verifications by automating the end-to-end software processes with zero manual involvement. End-to-end software process could be a validation of a process flow enabled by a software right from the beginning of the process to the end of the process. This could be a combination of use-cases that outline the functionalities of a software application. Almost everything meaningfully automated could be run anytime and anywhere; however, many times we need to rely on a trigger such as an event-based or a database based. Test automation, when done right, along with processes such as test-driven development, model-specific language for testing and behaviour-driven testing etc., can improve the efficiency, coverage and quality of the work product quickly. Additionally, with good quality test automation, the ability to build reusable libraries and modularization of the code is another benefit that can save a lot of time and money across the board, at the module level, project level or enterprise level.
Some of the key benefits of test automation include (but not limited to):
  • Cost Savings
    • Cost Savings in terms of:
      • Manual test effort reduction
      • Removal of defects quickly
    • Cost avoidance in terms of:
      • Reduction in regression defects
      • Removal of wastages
  • Reusability
    • Ability to write once and reuse multiple time through:
      • Modular design
      • Efficiency in configuration and clonability
  • Faster time to market
    • Efficient automation helps to reduce test execution time, as test cases can be run in parallel, in an unattended fashion and across platforms
    • Tests can be triggered automatically without dependency on humans
  • Better test coverage
    • With test automation, a testing team can have a better test coverage for stability. However, important code branches, business functionalities need to automate by leveraging manual testing experts. Automation can help the skilled manual testers to focus on areas needing high business and functional knowledge on rapidly changing business-critical code branches of an application.
  • Early defect finding
    • Having an automated test suite for regression allows us to find defects early and fixing them as well.
  • Efficient testing
    • Test automation gives the testing team to run the test cycle efficiently and plan overall test strategy in the optimal manner for efficient outcomes.
  • Repeatability
    • It can be repeated in the same format as the automation is coded to run in the same way without the variations shown by human testers.
    • Repeating, in the same manner, gives a clear view of application behaviour.
  • Avoidance of manual errors
    • As the test automation scripts follow a logic, manual errors, such as mistyping, clicking wrong buttons or other types of errors, can be avoided using test automation.
  • Reuse of Skilled Testers
    • Skilled testers can be leveraged to run high value-adding testing tasks instead of running low-risk, low-value adding, monotonous test scripts.
  • Ability to run in parallel
    • Test automation gives the test team with an ability to run in parallel with multiple data sets, devices and platforms.

History of test automation

To understand the history of test automation, we need to first understand some of the key progress made in terms of software testing and then in test automation. Let us study them:
  • 1958 – First independent testing consultants incorporated in the PROJECT MERCURY program.
  • In 1961 – Leeds and Weinberg published the first chapter on Program testing in the book “Computer Programming Fundamentals”.
  • 1962 – Automatic Program Testing by IBM’s Renfe becomes the first full-fledged testing book.
  • In the 1970’s, test automation picked up steam, TRW and IBM published first papers on test automation. The first seminal book on software testing was published in the early 70s – Program Test Methods.
  • Even IBM Mainframe computers had automation tools such as SIMON or OLIVER that helped automate user interfaces or batch program execution. Test automation picked up steam in the most established computing systems of the time – Mainframes.
  • NASA’s Johnson Space Centre built an automated tool called Automate...

Table of contents