Day1: Look up some definitions for 'Automation', compare them against definitions for 'Automation Testing'.

Automation is the creation of technology and its application in order to control and monitor the production and delivery of various goods and services. It performs tasks that were previously performed by humans. Automation is being used in a number of areas such as manufacturing, transport, utilities, defence, facilities, operations and lately, information technology. In IT domain, a software script can test a software product and produce a report. There are also various software tools available in the market which can generate code for an application. In other industries, automation is greatly improving productivity, saving time and cutting costs. Automation Testing means using an automation tool to execute your test case suite.

Advantages, Disadvantages and Limitations of test automation

Advantages of test automation include: 
 More tests can be run per build
 The possibility to create tests that cannot be done manually (real-time, remote, parallel tests)
 Tests can be more complex
 Tests run faster  Tests are less subject to operator error
 More effective and efficient use of testing resources
 Quicker feedback regarding software quality
 Improved system reliability (e.g., repeatability, consistency)
 Improved consistency of tests

Disadvantages of test automation include: 
 Additional costs are involved
 Initial investment to setup TAS
 Requires additional technologies
 Team needs to have development and automation skills
 On-going TAS maintenance requirement
 Can distract from testing objectives, e.g., focusing on automating tests cases at the expense of executing tests
 Tests can become more complex
 Additional errors may be introduced by automation

Limitations of test automation include: 
 Not all manual tests can be automated
 The automation can only check machine-interpretable results
 The automation can only check actual results that can be verified by an automated test oracle
 Not a replacement for exploratory testing

POM for UI automation testing

We are now doing an UI automation testing in Selenium WebDriver. It is not a tough task because we are following POM, just need to find elements and perform operations on them. So, what is POM?
POM stands for Page Object Model. 

As be seen in above photo, under this model, for each web page in the application, we create a corresponding page class for it. This page class will find the WebElements of that web page and also we dedine page methods to perform operations on those WebElements. We put all the page classes in a Pages folder.

And then we create a separate class to do all the tests, puting all test methods in that class file. In the future, if any element is changed, we just need to change element in the page class instead of in every test related to that element. 

Code becomes less and optimized because of the reusable page methods in the POM classes!




What is the difference between driver.close() and driver.quit() command in Selenium WebDriver

Driver.close(): closes the web browser window that the user is currently working on, or we can also say the window that is being currently accessed by the WebDriver. 
Driver.quit(): closes down all the windows that the driver has opened. 
Note that both commands neither require any parameter nor return any value.

What are the different types of waits available in WebDriver?

1. Implicit Waits 2. Explicit Waits 3. Fluent Wait

The Implicit Wait is specific to the entire Browser or all the elements in the browser. When you define certain period (say 10 Secs) it suspends the further action for 10 secs. It doesn't bother whether the particular/all element(s) loaded or not on the browser.
Different elements on the page takes different times to load on the page, if we use implicit wait for 10 Sec there is no guarantee that all the elements loaded within 10 sec, some elements may take more than 1 minute, in such conditions Explicit waits can be used to wait for that particular element.

The explicit wait is used to tell the Web Driver to wait for certain conditions (Expected Conditions) or the maximum time exceeded before throwing an "ElementNotVisibleException" exception.

The fluent wait is used to tell the web driver to wait for a condition, as well as the frequency with which we want to check the condition before throwing an "ElementNotVisibleException" exception.