Cyber Forensic Practical COdes
Cyber Forensic Practical COdes
#AIM: Install Selenium IDE. Write a test suite containing minimum 4 test cases for different
formats.
REQUIREMENTS:
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();">
<input type="button" name="sub" value="Subtract"
onclick="javascript:subtraction();">
<input type="button" name="mul" value="Multiply"
onclick="javascript:multiplication();">
<input type="button" name="div" value="Divide"
onclick="javascript:division();">
</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:
• 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”:
• We’ll be prompted to paste our URL again, then click Start Recording:
• NOTE THAT each clicks are recorded:
• Now create 3 more test cases(subtraction, multiplication, division). Then “Run all tests”:
6) Finish!