ST Lab File Structured
ST Lab File Structured
GREATER NOIDA
LAB RECORD
1. Do while
2. While
3. If else
4. Switch
5. For
AIM :To demonstrate the working of the if else construct
using python
Code:
if (n == 0):
print("Number is neutral")
elif (n % 2 == 0):
print(f"{n} is even")
else:
print(f"{n} is odd")
TEST CASE 1:
TEST CASE 2:
Code:
def check_number():
# While loop to continuously take input until the user chooses to stop
while True:
if number > 0:
break
break
else:
check_number()
TEST CASE 1:
TEST CASE 2:
switch = {
1: "Option 1 selected",
2: "Option 2 selected",
3: "Option 3 selected",
result = switch_case(choice)
print(result)
TEST CASE 1:
rows_A = len(A)
cols_A = len(A[0])
rows_B = len(B)
cols_B = len(B[0])
if cols_A != rows_B:
# Create the result matrix with appropriate dimensions (rows of A and columns of B)
for i in range(rows_A):
for j in range(cols_B):
for k in range(cols_A):
# Example matrices
A=[
[1, 2],
[3, 4]
B=[
[5, 6],
[7, 8]
result = multiply_matrices(A, B)
print("Resultant Matrix:")
print(row)
Test case 1:WHEN ROWS AND COLS ARE EQUAL
Enter the number of [30, 36, 42] [30, 36, 42] Pass
rows = 3
[66, 81, 96] [66, 81, 96]
Enter the number of
column = 3 [102, 126, 150] [102, 126, 150]
Facility Required
2.verify the terms Click on the terms and The terms and The terms and Pass
and conditions condition link condition page or a condition page is
link is clickable popup should be opening
open
3.verify that Try submitting the form The “register Registration Pass
registration is without checking the button should button should
disabled if the terms and conditions remain disabled or remain disabled
checkbox is checkbox an error message
unchecked should appear
4.verify that Fill in all required fields The “register Registration Pass
registration is and check the terms and button should button should be
enabled if the conditions checkbox enabled and no enabled
checkbox is before submitting error message
checked should appear
5.verify that the Load the registration The terms and The terms and Pass
checkbox remains page and observe the condition checkbox condition
unchecked by state of checkbox should remain checkbox should
default unchecked by remain
default unchecked by
default
6.verify error Try submitting the form An error message Error message is Pass
message when without selecting the should be shown
submitting terms and conditions displayed, on
without checking checkbox registration page
the checkbox after clicking the
submit button.
7.verify the Check if the text for The text should be The text is Pass
consistency of terms and conditions is legible ,properly legible ,formatted
terms and correctly formatted and formatted and properly and
conditions displayed. linked correctly linked correctly
text/link
8.verify checkbox Click the checkbox The checkbox The checkbox is Pass
functionality multiple times to check if should be selected if it is
it toggles correctly selectable and not clicked once and
selectable without deselected if it is
issue clicked twice or
double
9. verify if terms Click on terms and The terms and It is open in new Pass
and conditions conditions link and condition should tab
open in a new observe behavior open in a new tab
tab(if applicable) or modal
window ,dependin
g on system
behavior
Experiment no -5
1.Page load time Measure the time The page should Page opened within Pass
taken for the load within 3 3 seconds
registration page to seconds
fully load
2.Response time for Fill in all details and The form should be Page opened within Pass
submission submit the submitted within 2- 1-2 seconds
form ,measuring 5 seconds
the response time
3.System behavior Simulate a slow The page should The page opened Pass
with slow internet internet connection load with slight with a slight delay(2
delay (2-3 minute) minute)
And try loading the
registration page
4.Handling high Simulate multiple The page should The page is having Pass
traffic load users (eg . 100 – handle high traffic high traffic due to
500 concurrent without crashing or which system
users )accessing the slowing down (Registration
registration page significantly page )slows down
5.Form input field Type quickly in all The field should The field responded Pass
input fields and respond instantly instantly without
check for any lag or without delay delay
delay
6 Database Query Measure the time Queries should Queries executed Pass
performance taken to verify and execute within 1-3 within 1-3 seconds
store user details in seconds
the database upon
registration
7.Captcha load time Check the time Captcha should Captcha loaded Pass
taken for captcha load within 1 within 1 seconds
to appear on the seconds
registration form (if
applicable )
8.Performance on Open the The page should The page loaded Pass
registration page load smoothly smoothly across all
different devices on various across all devices devices
devices(mobile ,tab
let, laptop)
9.Loading time of Open the The page opened The page opened Pass
registration page registration page within 2- 3 seconds within 2- 3 seconds
on different devices on various across all devices across all devices
devices(mobile ,tab
let, laptop)
Experiment – 6
Write the test case for the functionality in registration page
Test Case Steps Expected Result Actual Result Remarks
2.Verify Enter an existing User should see an Error message Pass or username
registration page username error message displayed validation working
indicating the “username is correctly
username is already exists”
already registered
3.Verify password Enter a weak User should see an Error message Password validation
limitation password (less error message displayed working correctly
than 8 characters) indicating the “Password must be
password is too greater than 8
weak characters
4.Validate email id Enter invalid email User should see an Error message Email validation
address format error message displayed “Invalid working correctly
indicating the email email address
address is not valid format
5.username field Leave the User should see an Error message Username validation
empty username field error message displayed working correctly
blank indicating the “username is
username is required”
required
6.Password field Leave the User should see an Error message Password validation
empty password blank error message displayed working correctly
indicating the “password is
password is required”
required
Experiment 7 :
1.Verify Https Check the registration page The page The page is Pass
encryption URL starts with https//: should be secured with
secured with HTTPS
HTTPS
2.SQL injection Enter sql queries (OR The system The system Pass
Prevention 1=1 )in input fields and should reject rejected
submit malicious malicious
inputs and inputs and
display an error display an error
6.Brute force Try multiple failed The system The system Pass
attack registration with the same should implemented
prevention email and incorrect implement rate rate limiting or
passwords limiting or CAPTCHA after
CAPTCHA after several failed
several failed attempts
attempts
EXPERIMENT NO:8
1.Verify login Enter valid User should be able Login successful Pass
credential username and to login successfully
password
1. Verify the Open the login The login page Username input PASS
presence of page of bank should have a field present
username and see if there username input
input field is username field
field
2. Verify the Open the login The login page Login button PASS
presence of page of bank should have a present
password and see if there login button
input field is password
field
3. Verify the Open the login The login page Username input PASS
presence of page of bank should have a field present
login button and see if there username input
is login button field
5. Verify the Open the login The login page “Remember PASS
presence of a page of bank should have a me” checkbox
check box for scroll down and check box for present
“Remember check for the “Remember
me” remember me me” option
box
6. Verify the Open the login The username Input fields PASS
layout and page of bank and password aligned and
alignment of and check input fields properly spaced
input fields should be
aligned properly
and have
consistent
spacing
7. Verify the Open the login Error message Error message PASS
visibility and page of bank for invalid displayed near
placement of and check credentials or the respective
error message missing fields fields
should be
displayed
prominently
and in an
appropriate
location
8. Verify the Open the login The login page “Create PASS
visibility of a page of bank should adapt a account” link
“create and check link to create a visible
account” link create account new account
is visible
9. Verify the Open the login The login page Login page PASS
responsiveness page of bank should adapt to adjusts well to
of the login and do some different screen different screen
page activities to size and size
check the resolution
response
10. Verify the Open the login The login page Visual design PASS
overall visual page of bank should have a follows the
design and and see for visually application’s
branding visual effects. appealing branding
design guidelines
consistent with
the
application’s
branding
Experiment 10.
Write a test case based on the performance of login page .
Test case steps Expected outcome Actual Result
Outcome
2.Captcha code Click on login now Login page should Login page has Pass
for existing user display captcha code captcha code
visible
3.Session timeout Wait for 15 min on Login page should Page did not Fail
login page prompt user session display user
timeout session
timeout
4.Refresh captcha In the login page The captcha should New captcha Pass
Click on refresh be refreshed and displayed
button beside of new captcha shown within 1
captcha code within 2-3 seconds second
5.Response time for After filing out the After login bank Home page Pass
login submission details (user id and service page should opened within
password) opened within 2 seconds
seconds
Click on login
button
6.System behavior With slow internet The page should The page Pass
with slow internet click on login button opened within 1-2 opened within
minutes 1 minute
9.Loading time of Open the login page The page opened The page opened Pass
login page on on various within 2- 3 seconds within 2- 3 seconds
different devices devices(mobile ,tabl across all devices across all devices
et, laptop)
10.Database Query Measure the time Queries should Queries executed Pass
performance taken to verify and execute within 1-3 within 1-3 seconds
store user details in seconds
the database upon
login
11.Form input field Type quickly in all The field should The field Pass
input fields and respond instantly responded
check for any lag or without delay instantly without
delay delay
12.Handling high Simulate multiple The page should The page is having Pass
traffic load users (eg . 100 – handle high traffic high traffic due to
500 concurrent without crashing or which system
users )accessing the slowing down (login page )slows
login page significantly down
Experiment no :11
Write a test case based on the security of login page .
Test Case Steps Expected Result Actual Result Remarks
1.Verify Check the The page should be The page is secured with Pass
Https registration secured with HTTPS
encryption page URL HTTPS(https://yonobusi (https://yonobusiness.sbi/lo
starts with ness.sbi/login/yonobusi gin/yonobusinesslogin)
https//: nesslogin)
2.Verify Fill the user For invalid user id ,it Does not show invalid Fail
existence details under should display invalid username
of User id user field username
3.Verify Fill the For invalid password ,it Does not show invalid Fail
existence password should display invalid password
of details under password
Password password field
6.Account Try registering A generic error should A generic error is displayed Pass
enumerati with an be displayed
on existing email
preventio and observe
n the error
message
7.SQL Enter sql The system should reject The system rejected Pass
injection queries (OR malicious inputs and malicious inputs and display
Preventio 1=1 )in input display an error an error
n fields and
submit
8.Cross Enter The script should not The script did not Pass
site <script>alert(‘X execute :an error should execute :an error message
Scripting SS’)</script> be displayed displayed
(XSS)preve
ntion In input fields