ASE Lab
ASE Lab
ASE Lab
A Report submitted in partial fulfilment of the Requirements for the award of the degree of
Bachelor of Technology in
INFORMATION TECHNOLOGY
Submitted by:
Tanishq Verma
Roll No. 12112001
Branch: IT
Supervised by:
Dr. Vinay Pathak
(Assistant Professor)
A Test Case Template is a well-designed document for developing and better understanding of the
test case data for a particular test case scenario. A good Test Case template maintains test artifact
consistency for the test team and makes it easy for all stakeholders to understand the test cases.
Writing test case in a standard format lessen the test effort and the error rate. Test cases format are
more desirable in case if you are reviewing test case from experts.
The template chosen for your project depends on your test policy. Many organizations create test
cases in Microsoft Excel while some in Microsoft Word.
Irrespective of the test case documentation method chosen, any good test case template must have
the following fields:
Name of Determine the name of the main module or sub-module being tested
the
Module:
Test Tester’s Name
Designed
by:
Date of test Date when test was designed
designed:
Test Who executed the test- tester
Executed
by:
Date of the Date when test needs to be executed
Test
Execution:
Name or Title of the test case
Test Title:
Descriptio Determine the summary or test purpose in brief
n/Summar
y of Test:
Pre- Any requirement that needs to be done before execution of this test case.
condition: To execute this test case list all pre-conditions
Dependenc Determine any dependencies on test requirements or other test cases
ies:
Test Steps: Mention all the test steps in detail and write in the order in which it requires to be executed.
While writing test steps ensure that you provide as much detail as you can.
Test Data: Use of Test Data as an input for the test case. Deliver different data sets with precise values
to be used as an input
Expected Mention the expected result including error or message that should appear on screen
Results:
Post- What would be the state of the system after running the test case?
Condition:
Actual After test execution, actual test result should be filled
Result:
Status Mark this field as failed, if actual result is not as per the estimated result
(Fail/Pass):
Notes: If there are some special condition which is left in above field
Test Case ID BU_001 Test Case Test the Login Functionality in Banking
Description
Created By Mark Reviewed By Bill Version 2.1
Test Verify on entering valid userid and password, the customer can
Scenario login
Step # Step Details Expected Results Actual Results Pass / Fail / Not executed /
Suspended
1 Navigate to Site should open As Expected Pass
http://demo.guru99.com
2 Enter Userid & Password Credential can be As Expected Pass
entered
3 Click Submit Cutomer is logged As Expected Pass
in
4
Experiment 2
Understanding the core concept of Browser driver classes and Webdriver interface.
Browser Driver:
For each browser you aim to automate using Selenium, a corresponding browser driver is essential.
These drivers serve as intermediaries, facilitating seamless communication between Selenium and the
browser. For Chrome, you would require chromedriver.exe (on Windows) or chromedriver (on
macOS/Linux), provided by the respective browser vendors like Google for Chrome and Mozilla for
Firefox.
These browser drivers have the capability to control the browser but don’t inherently know what
actions to perform. That’s where Selenium comes into play. Through the WebDriver instance,
Selenium directs the browser driver, specifying actions like opening a web page or clicking a button.
WebDriver Interface:
Selenium WebDriver is an interface that defines a set of methods. However, implementation is
provided by the browser specific classes. Some of the implementation classes
are AndroidDriver, ChromeDriver, FirefoxDriver, InternetExplorerDriver, IPhoneDriver, SafariDriver
etc. The WebDriver main functionality is to control the browser. Kinda like a remote control. It even
helps us to select the HTML page elements and perform operations on them such as click, filling a
form fields etc.
Experiment 3
Here we ran a test case to get title of a particular webpage, in this case https://iiitsonepat.ac.in,
using Chrome driver.
package org.example;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.WebDriver;
driver.get("https://www.selenium.dev/selenium/web/web-
form.html");
driver.getTitle();
driver.manage().timeouts().implicitlyWait(Duration.ofMillis(500));
5. Find an element
textBox.sendKeys("Selenium");
submitButton.click();
message.getText();
driver.quit();
Experiment 5
Identifying the web elements usinf following locators (with live examples):
• Id
• Xpath
• Css selectors
• Name
• Classname
• TagName
• Link Text
1. ID:
• HTML element with a unique identifier.
2. XPath:
• XML Path Language (XPath) allows for navigating through the XML structure of
an HTML document.
<button
xpath="//button[@class='submitButton']">Submit</button>
WebElement elementByXPath = driver.findElement(By.xpath
("//button[@class='submitButton']"));
3. CSS Selectors:
• CSS selectors allow for selecting HTML elements based on their attributes,
classes, or IDs.
4. Name:
• HTML elements with a specified name attribute.
5. Classname:
• HTML elements with a specified class attribute.
<div class="container">
<p>Hello, World!</p>
</div>
WebElement elementByClass =
driver.findElement(By.className("container"));
6. Tag Name:
• HTML elements with a specified tag name.
<h1>Welcome to Example.com</h1>
WebElement elementByTagName =
driver.findElement(By.tagName("h1"));
7. Link Text:
• HTML anchor elements (<a>) with specific visible text.
Using regular expressions (regex) to identify objects in Selenium WebDriver can be helpful when
dealing with dynamic or changing attributes of web elements. Here are some techniques for using
regex with Selenium:
You can use regex to match only a part of an attribute value, which can be useful when the
attribute value contains dynamic or changing parts.
WebElement element =
driver.findElement(By.xpath("//input[contains(@id,
'username')]"));
2.Text Matching:
Regex can be used to match specific text within elements, especially when the text content is
dynamic or contains variable parts.
WebElement element =
driver.findElement(By.xpath("//a[contains(text(),
'Click')]"));
You can combine regex-based locators with other locator strategies like CSS selectors, class
names, etc., for more precise element identification.
WebElement element =
driver.findElement(By.cssSelector("input[id^='user']"));
Experiment 7
There are three primary Types of Functional Testing at the system and UI levels:
1. Smoke Testing: Smoke testing is a quick way to make sure your built is Functioning
Correctly. Every time you build your code, you should at the very least perform a smoke test,
even if no changes were made. Instead of extensively testing everything, this usually entails
going through the key user processes.
2. Regression Testing: Verifying that the product still Works As Intended after Recent
Changes is the goal of regression testing. This is crucial if you’ve changed the functionality
or introduced any new code. Additionally, if you have performed any problem fixes—and bug
patches have a nasty way of affecting other bits of code—it is necessary. This is a
significantly more time-consuming method that must test each moving component of your
software.
Example:
package org.example;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.WebDriver;
1. Download the installer using the download button provided on the official docker website.
2. Double-click Docker Desktop Installer.exe to run the installer. By default, Docker Desktop
is installed at C:\Program Files\Docker\Docker.
3. When prompted, ensure the Use WSL 2 instead of Hyper-V option on the Configuration
page is selected or not depending on your choice of backend.
If your system only supports one of the two options, you will not be able to select which backend
to use.
4. Follow the instructions on the installation wizard to authorize the installer and proceed
with the install.
5. When the installation is successful, select Close to complete the installation process.
If your admin account is different to your user account, you must add the user to the docker-
users group:
1. Run Computer Management as an administrator.
2. Navigate to Local Users and Groups > Groups > docker-users.
3. Right-click to add the user to the group.
4. Sign out and sign back in for the changes to take effect.
Experiment 9
Operations on images-
Images can be pulled from the docker hub using the “docker pull {imageName}” command.
The previously downloaded image can be used to run a container using the “docker run
{imageName}” command.
Experiment 10
Finding number of images, containers running on host machine and various relevant operations
such as –
• Finding number of processes running vs process running inside container.
• Existing container, renaming container, collecting container statistics, removing container
history, inspect
3. Finding the Number of Processes Running vs. Processes Running Inside Containers:
• To find the number of processes running on your host machine, you can use the ps
command. To find the number of processes running inside Docker containers, you can use
the docker top command for each running container and count the output lines.
4. Existing Container Operations:
• Renaming a Container:
• Inspecting a Container:
Experiment 11
1) Run a Container:
Start by running a Docker container based on an existing image. You can use the docker
run command to start a container from any image available on Docker Hub or locally on
your machine.
Dockerfile directives are instructions used to build Docker images. Some basic Dockerfile
directives along with their usage are:
1. FROM:
• The FROM directive specifies the base image for your Dockerfile. It's the starting point
for your image.
2. RUN:
• The RUN directive executes commands in the Docker image. It's used to install packages,
run scripts, etc.
3. COPY:
• The COPY directive copies files or directories from the host machine to the Docker image.
4. WORKDIR:
• The WORKDIR directive sets the working directory for any RUN, CMD, ENTRYPOINT,
COPY, and ADD instructions that follow it.
5. CMD:
• The CMD directive specifies the default command to run when a container is started.
6. EXPOSE:
• The EXPOSE directive informs Docker that the container listens on specific network ports
at runtime.
7. ENV:
• The ENV directive sets environment variables in the Docker image.
I. Create a Dockerfile with all the necessary information regarding the image to be created.
II. Build the docker image using the docker build command
III. Now you can see the image stored using the docker images command