Automation
Automation
A. Maven Repository
● In the tear down what we can do is we can simply close the browser right so usually in
the teardown what you do you, you close the browser. You log off the application so all
of that logic we can maintain or move it into the teardown right so we can simply say
driver.close().
● The Java Thread.sleep() method can be used to pause the execution of the current
thread for a specified time in milliseconds.
E. Remove Hardcoded FilePath in Framework
● This directory is named by the system property user. dir, and is typically the directory in
which the Java virtual machine was invoked. In other words, user. dir is the working
directory of the process that started the Java process at the time when it started the
process.
Figure 1.1 - User.dir 2
● Data driven testing when we say data driven testing it is basically say for example you
want to iterate through the data so if there is a registration functionality so you want to
register 100 users on a web portal then you provide the user data for each of these
users and there is a single script that populates all that data right picking up the rows
from the excel sheet or from the data provider and populates all that data into the form
and submits the form right or does the user registration so you do not have to write
rewrite the script 100 times and hard code hundred percent or hundred people's data in
those hundred test cases single test case is enough as far as you have this data driven
approach.
● https://testng.org/doc/documentation-main.html#parameters-dataproviders
Reference: https://en.wikipedia.org/wiki/Apache_POI#:~:text=The%20name%20was
%20originally%20an,they%20were%20successfully%20reverse%2Dengineered.
● Apache POI, a project run by the Apache Software Foundation, and previously a sub-
project of the Jakarta Project, provides pure Java libraries for reading and writing files in
Microsoft Office formats, such as Word, PowerPoint and Excel.
● The name was originally an acronym for "Poor Obfuscation Implementation", referring
humorously to the fact that the file formats seemed to be deliberately obfuscated, but
poorly, since they were successfully reverse-engineered. This explanation – and those
of the similar names for the various sub-projects – were removed from the official web
pages in order to better market the tools to businesses who would not consider such
humor appropriate. The original authors (Andrew C. Oliver and Marc Johnson) also
noted the existence of the Hawaiian poi dish, made of mashed taro root, which had
similarly derogatory connotations.
Figure 1.4 - The Main Method in Java is Not Needed when using TestNG
● Basically smoke testing came from the smoke testing done by the plumbers and usually
the plumbers used to do smoke test whenever they used to find or they wanted to find
any leakage into the pipes right so what they did is they physically say for example this
is the pipe and they wanted to find the leaks so if there are you know if they'll seal it
basically from one side or whether whether it's sealed and then from one side they'll put
you know like smoke within it and if there is you know like any smoke coming out of this
particular pipe then they will recognize that yes there is a leakage within the pipe right so
this is how plumbers used to do smoke testing.
○ During the Initial phase when the builds are relatively unstable
○ Detailed testing
● Sanity testing is when the builds have become stable and you are verifying some of the
key functionalities after the defect fix or the new functionality is being added.
● When the build becomes stable then you do the sanity testing if there is any new fix or
new defect fix or new functionality that comes in so you do a sanity check of the defect
fix module or the or the new module that came in before you get into the detailed
regression or the full regression cycle right so b progress further or everyone in the test
team can progress further with the detailed testing of the build.