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.

hard assertions and soft assertions in c#

Hard assertions:
When a hard assertion fails, it throws out an exception immediately and the code after the assertion shouldn't be excuted,the test case is failed.

Soft assertions:
When a soft assertion fails, it does not throw out an exception, and would continue with the next steps after the soft assertion.

When to use hard assertions?
When a step in the test is very important, if this step fails, the following steps shouldn't go on, you may put a particular hard assertion to verify this step, if the hard assertion fails, the testing stops and the test case is failed. For example, when you test "login in a page and then do some operations after login", if login fails, the next operations can't be done, in that situation, you can put a hard assertion to verify the login operation. If the assert fails, testing excution stops, test case is failed.

When to use soft assertions?
In some situations, even the current test step fails, you may still want to do the next steps, then you can put a soft assert to verify the current step. If it fails, it only gets a fail log but the testing excution keeps going on. The next test steps should be run. For example, you want to print 4 items, if one of them fails, you still hope to print the next one. In that situation, you may put soft assertion to verify the test step "print one item", even it fails, the testing excution will goes on to print next items, and the test case will be passed.

SOAP and REST

Simple Object Access Protocol (SOAP) and Representational State Transfer (REST) are two answers to the same question: how to access Web services.

SOAP is a standards-based Web services access protocol that has been around for a while and enjoys all of the benefits of long-term use. Originally developed by Microsoft, SOAP really isn’t as simple as the acronym would suggest.

REST is the newcomer to the block. It seeks to fix the problems with SOAP and provide a truly simple method of accessing Web services. However, sometimes SOAP is actually easier to use; sometimes REST has problems of its own. Both techniques have issues to consider when deciding which protocol to use.

SOAP is described by WSDL, and communicate using XML.

REST APIs are visited by URIs, and communicate using XML, HTML, or JSON, mostly JSON. REST APIs use POST, GET,PUT,DELETE methods of HTTP to manipulate the resource.


SOAP example:

REST example: