0% found this document useful (0 votes)
35 views9 pages

Cyber Forensic Practical COdes

Uploaded by

mageerauldxrzfp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views9 pages

Cyber Forensic Practical COdes

Uploaded by

mageerauldxrzfp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

#503(prac1)---22/06/19---

#AIM: Install Selenium IDE. Write a test suite containing minimum 4 test cases for different
formats.

REQUIREMENTS:

1) Selenium IDE extension on a browser.


2) NetBeans IDE for creating test case files.

STEPS:

1) Just google “Selenium IDE chrome” and click on the first link. Add the “Selenium IDE”
extension to your browser.

2) For testing, we need a test case suite, so we create a WebApplication in NetBeans IDE.

File > New Project > Java Web > Web Application > Add GlassFish Server > Finish.

3) In index.html, we write the following code for “ARITHMETIC OPERATIONS” test case suite:
---index.html---
<html>
<head>
<title>prac1</title>
<script language="javascript">
function addition()
{
var num1=parseInt(document.arithmetic.n1.value);
var num2=parseInt(document.arithmetic.n2.value);
var result=num1+num2;
document.arithmetic.res.value=result;
}

function subtraction()
{
var num1=parseInt(document.arithmetic.n1.value);
var num2=parseInt(document.arithmetic.n2.value);
var result=num1-num2;
document.arithmetic.res.value=result;
}

function multiplication()
{
var num1=parseInt(document.arithmetic.n1.value);
var num2=parseInt(document.arithmetic.n2.value);
var result=num1*num2;
document.arithmetic.res.value=result;
}

function division()
{
var num1=parseInt(document.arithmetic.n1.value);
var num2=parseInt(document.arithmetic.n2.value);
var result=num1/num2;
document.arithmetic.res.value=result;
}
</script>
</head>

<body>
<h1 align="center"> Arithmetic Operations </h1>
<form name="arithmetic">
<table border="1" align="center">

<tr>
<td>Number 1: </td>
<td><input type="text" name="n1" size="20"></td>
</tr>

<tr>
<td>Number 2: </td>
<td><input type="text" name="n2" size="20"></td>
</tr>

<tr>
<td colspan=2>
<input type="button" name="add" value="Add"
onclick="javascript:addition();">&nbsp;
<input type="button" name="sub" value="Subtract"
onclick="javascript:subtraction();">&nbsp;
<input type="button" name="mul" value="Multiply"
onclick="javascript:multiplication();">&nbsp;
<input type="button" name="div" value="Divide"
onclick="javascript:division();">&nbsp;
</td>
</tr>

<tr>
<td colspan="2">Result is: <input type="text" name="res" size="20"
value=""></td>
</tr>

</table>
</form>
</body>
</html>

4) Create a JSP file “newjsp.jsp” with a link to the created HTML file.
---newjsp.jsp---
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body align="center">
<h1>Test Cases IDE</h1>
<a href="index.html">Arithmetic Operations</a>
</body>
</html>
5) Run this JSP file from NetBeans. It will then open up in a browser.
• Then from the browser, open the link:

• Now you’ll be redirected to ARITHMETIC OPERATIONS page.


Copy the URL of the page and open “Selenium IDE” extension:

• Now, Record a new test project in a new project:


• Name your project:

• Paste that URL here and click Start Recording:

• A new tab will be opened, maximize that tab(this tab is your working tab for recording):
• Click on Stop Recording:

• Just as you stop your recording, you’ll be prompted to Name your new test, we’ll make
our new test as “addition”:

• Save the project after each test case:


• A file with “.SIDE” extension will be saved(SIDE abbrev to Selenium IDE):

• Now, we’ll Start Recording our first test case(addition):

• We’ll be prompted to paste our URL again, then click Start Recording:
• NOTE THAT each clicks are recorded:

• Now we’ll Stop Recording from the Selenium IDE:

• We’ll then Run current test(addition):


• The test will run automatically and the completion will be shown step-by-step in the
“Log” area in the Selenium IDE:

• NOTE1: You can set the “Test execution speed” too:


• NOTE2: Paste here the URL again if the Glassfish Error occurs between any test case:

• Now create 3 more test cases(subtraction, multiplication, division). Then “Run all tests”:

6) Finish!

You might also like