Commit 5864dbec authored by Đỗ Gia Hưng's avatar Đỗ Gia Hưng

automation_sele

parent 7e3780a9
{
"java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "automatic",
"files.exclude": {
"**/.github": true,
"**/.vscode": true,
"**/target": true
}
}
\ No newline at end of file
com\automation\testcases\BasicWebDriverCommandsTest.class
com\automation\testcases\WebElementCommandsTest.class
C:\New folder\automation_selenium\src\test\java\com\automation\testcases\BasicWebDriverCommandsTest.java
C:\New folder\automation_selenium\src\test\java\com\automation\testcases\WebElementCommandsTest.java
<html>
<head>
<title>TestNG: Surefire test</title>
<link href="../testng.css" rel="stylesheet" type="text/css" />
<link href="../my-testng.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.log { display: none;}
.stack-trace { display: none;}
</style>
<script type="text/javascript">
<!--
function flip(e) {
current = e.style.display;
if (current == 'block') {
e.style.display = 'none';
return 0;
}
else {
e.style.display = 'block';
return 1;
}
}
function toggleBox(szDivId, elem, msg1, msg2)
{
var res = -1; if (document.getElementById) {
res = flip(document.getElementById(szDivId));
}
else if (document.all) {
// this is the way old msie versions work
res = flip(document.all[szDivId]);
}
if(elem) {
if(res == 0) elem.innerHTML = msg1; else elem.innerHTML = msg2;
}
}
function toggleAllBoxes() {
if (document.getElementsByTagName) {
d = document.getElementsByTagName('div');
for (i = 0; i < d.length; i++) {
if (d[i].className == 'log') {
flip(d[i]);
}
}
}
}
// -->
</script>
</head>
<body>
<h2 align='center'>Surefire test</h2><table border='1' align="center">
<tr>
<td>Tests passed/Failed/Skipped:</td><td>2/0/0</td>
</tr><tr>
<td>Started on:</td><td>Mon May 04 16:17:07 ICT 2026</td>
</tr>
<tr><td>Total time:</td><td>23 seconds (23048 ms)</td>
</tr><tr>
<td>Included groups:</td><td></td>
</tr><tr>
<td>Excluded groups:</td><td></td>
</tr>
</table><p/>
<small><i>(Hover the method name to see the test class name)</i></small><p/>
<table width='100%' border='1' class='invocation-passed'>
<tr><td colspan='4' align='center'><b>PASSED TESTS</b></td></tr>
<tr><td><b>Test method</b></td>
<td><b>Attribute(s)</b></td>
<td width="30%"><b>Exception</b></td>
<td width="10%"><b>Time (seconds)</b></td>
<td><b>Instance</b></td>
</tr>
<tr>
<td title='com.automation.testcases.BasicWebDriverCommandsTest.testBasicCommands()'><b>testBasicCommands</b><br>Test class: com.automation.testcases.BasicWebDriverCommandsTest</td>
<td></td>
<td>11</td>
<td>com.automation.testcases.BasicWebDriverCommandsTest@75f32542</td></tr>
<tr>
<td title='com.automation.testcases.WebElementCommandsTest.testFindAndInteractWithElements()'><b>testFindAndInteractWithElements</b><br>Test class: com.automation.testcases.WebElementCommandsTest</td>
<td></td>
<td>7</td>
<td>com.automation.testcases.WebElementCommandsTest@5276e6b0</td></tr>
</table><p>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by org.testng.reporters.JUnitXMLReporter -->
<testsuite ignored="0" hostname="LAPTOP-2B5AMESQ" failures="0" tests="2" name="Surefire test" time="23.048" errors="0" timestamp="2026-05-04T16:17:30 ICT">
<testcase classname="com.automation.testcases.BasicWebDriverCommandsTest" name="testBasicCommands" time="11.764"/>
<testcase classname="com.automation.testcases.WebElementCommandsTest" name="testFindAndInteractWithElements" time="7.989"/>
</testsuite> <!-- Surefire test -->
This diff is collapsed.
-------------------------------------------------------------------------------
Test set: TestSuite
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 23.42 s -- in TestSuite
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "https://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>TestNG Report</title>
<style type="text/css">table {margin-bottom:10px;border-collapse:collapse;empty-cells:show}th,td {border:1px solid #009;padding:.25em .5em}th {vertical-align:bottom}td {vertical-align:top}table a {font-weight:bold}.stripe td {background-color: #E6EBF9}.num {text-align:right}.passedodd td {background-color: #3F3}.passedeven td {background-color: #0A0}.skippedodd td {background-color: #DDD}.skippedeven td {background-color: #CCC}.failedodd td,.attn {background-color: #F33}.failedeven td,.stripe .attn {background-color: #D00}.stacktrace {white-space:pre;font-family:monospace}.totop {font-size:85%;text-align:center;border-bottom:2px solid #000}.invisible {display:none}</style>
</head>
<body>
<table>
<tr><th>Test</th><th># Passed</th><th># Skipped</th><th># Retried</th><th># Failed</th><th>Time (ms)</th><th>Included Groups</th><th>Excluded Groups</th></tr>
<tr><th colspan="8">Surefire suite</th></tr>
<tr><td><a href="#t0">Surefire test</a></td><td class="num">2</td><td class="num">0</td><td class="num">0</td><td class="num">0</td><td class="num">23,048</td><td></td><td></td></tr>
</table>
<table id='summary'><thead><tr><th>Class</th><th>Method</th><th>Start</th><th>Time (ms)</th></tr></thead><tbody><tr><th colspan="4">Surefire suite</th></tr></tbody><tbody id="t0"><tr><th colspan="4">Surefire test &#8212; passed</th></tr><tr class="passedeven"><td rowspan="1">com.automation.testcases.BasicWebDriverCommandsTest</td><td><a href="#m0">testBasicCommands</a></td><td rowspan="1">1777886228761</td><td rowspan="1">11764</td></tr><tr class="passedodd"><td rowspan="1">com.automation.testcases.WebElementCommandsTest</td><td><a href="#m1">testFindAndInteractWithElements</a></td><td rowspan="1">1777886242000</td><td rowspan="1">7989</td></tr></tbody>
</table>
<h2>Surefire test</h2><h3 id="m0">com.automation.testcases.BasicWebDriverCommandsTest#testBasicCommands</h3><table class="result"><tr><th class="invisible"/></tr></table><p class="totop"><a href="#summary">back to summary</a></p>
<h3 id="m1">com.automation.testcases.WebElementCommandsTest#testFindAndInteractWithElements</h3><table class="result"><tr><th class="invisible"/></tr></table><p class="totop"><a href="#summary">back to summary</a></p>
</body>
</html>
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by org.testng.reporters.JUnitReportReporter -->
<testsuite hostname="LAPTOP-2B5AMESQ" failures="0" tests="1" name="com.automation.testcases.BasicWebDriverCommandsTest" time="13.744" errors="0" timestamp="2026-05-04T16:17:30 ICT" skipped="0">
<testcase classname="com.automation.testcases.BasicWebDriverCommandsTest" name="testBasicCommands" time="13.744"/>
</testsuite> <!-- com.automation.testcases.BasicWebDriverCommandsTest -->
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by org.testng.reporters.JUnitReportReporter -->
<testsuite hostname="LAPTOP-2B5AMESQ" failures="0" tests="1" name="com.automation.testcases.WebElementCommandsTest" time="9.268" errors="0" timestamp="2026-05-04T16:17:30 ICT" skipped="0">
<testcase classname="com.automation.testcases.WebElementCommandsTest" name="testFindAndInteractWithElements" time="9.268"/>
</testsuite> <!-- com.automation.testcases.WebElementCommandsTest -->
body {
margin: 0 0 5px 5px;
}
ul {
margin: 0;
}
li {
list-style-type: none;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.navigator-selected {
background: #ffa500;
}
.wrapper {
position: absolute;
top: 60px;
bottom: 0;
left: 400px;
right: 0;
overflow: auto;
}
.navigator-root {
position: absolute;
top: 60px;
bottom: 0;
left: 0;
width: 400px;
overflow-y: auto;
}
.suite {
margin: 0 10px 10px 0;
background-color: #fff8dc;
}
.suite-name {
padding-left: 10px;
font-size: 25px;
font-family: Times, sans-serif;
}
.main-panel-header {
padding: 5px;
background-color: #9FB4D9; /*afeeee*/;
font-family: monospace;
font-size: 18px;
}
.main-panel-content {
padding: 5px;
margin-bottom: 10px;
background-color: #DEE8FC; /*d0ffff*/;
}
.rounded-window {
border-radius: 10px;
border-style: solid;
border-width: 1px;
}
.rounded-window-top {
border-top-right-radius: 10px 10px;
border-top-left-radius: 10px 10px;
border-style: solid;
border-width: 1px;
overflow: auto;
}
.light-rounded-window-top {
border-top-right-radius: 10px 10px;
border-top-left-radius: 10px 10px;
}
.rounded-window-bottom {
border-style: solid;
border-width: 0 1px 1px 1px;
border-bottom-right-radius: 10px 10px;
border-bottom-left-radius: 10px 10px;
overflow: auto;
}
.method-name {
font-size: 12px;
font-family: monospace;
}
.method-content {
border-style: solid;
border-width: 0 0 1px 0;
margin-bottom: 10px;
padding-bottom: 5px;
width: 80%;
}
.parameters {
font-size: 14px;
font-family: monospace;
}
.stack-trace {
white-space: pre;
font-family: monospace;
font-size: 12px;
font-weight: bold;
margin-top: 0;
margin-left: 20px;
}
.testng-xml {
font-family: monospace;
}
.method-list-content {
margin-left: 10px;
}
.navigator-suite-content {
margin-left: 10px;
font: 12px 'Lucida Grande';
}
.suite-section-title {
margin-top: 10px;
width: 80%;
border-style: solid;
border-width: 1px 0 0 0;
font-family: Times, sans-serif;
font-size: 18px;
font-weight: bold;
}
.suite-section-content {
list-style-image: url(bullet_point.png);
}
.top-banner-root {
position: absolute;
top: 0;
height: 45px;
left: 0;
right: 0;
padding: 5px;
margin: 0 0 5px 0;
background-color: #0066ff;
font-family: Times, sans-serif;
color: #fff;
text-align: center;
}
.button{
position: absolute;
margin-left:500px;
margin-top:8px;
background-color: white;
color:#0066ff;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight:bold;
border-color:#0066ff ;
border-radius:25px;
cursor: pointer;
height:30px;
width:150px;
outline:none;
}
.top-banner-title-font {
font-size: 25px;
}
.test-name {
font-family: 'Lucida Grande', sans-serif;
font-size: 16px;
}
.suite-icon {
padding: 5px;
float: right;
height: 20px;
}
.test-group {
font: 20px 'Lucida Grande';
margin: 5px 5px 10px 5px;
border-width: 0 0 1px 0;
border-style: solid;
padding: 5px;
}
.test-group-name {
font-weight: bold;
}
.method-in-group {
font-size: 16px;
margin-left: 80px;
}
table.google-visualization-table-table {
width: 100%;
}
.reporter-method-name {
font-size: 14px;
font-family: monospace;
}
.reporter-method-output-div {
padding: 5px;
margin: 0 0 5px 20px;
font-size: 12px;
font-family: monospace;
border-width: 0 0 0 1px;
border-style: solid;
}
.ignored-class-div {
font-size: 14px;
font-family: monospace;
}
.ignored-methods-div {
padding: 5px;
margin: 0 0 5px 20px;
font-size: 12px;
font-family: monospace;
border-width: 0 0 0 1px;
border-style: solid;
}
.border-failed {
border-top-left-radius: 10px 10px;
border-bottom-left-radius: 10px 10px;
border-style: solid;
border-width: 0 0 0 10px;
border-color: #f00;
}
.border-skipped {
border-top-left-radius: 10px 10px;
border-bottom-left-radius: 10px 10px;
border-style: solid;
border-width: 0 0 0 10px;
border-color: #edc600;
}
.border-passed {
border-top-left-radius: 10px 10px;
border-bottom-left-radius: 10px 10px;
border-style: solid;
border-width: 0 0 0 10px;
border-color: #19f52d;
}
.times-div {
text-align: center;
padding: 5px;
}
.suite-total-time {
font: 16px 'Lucida Grande';
}
.configuration-suite {
margin-left: 20px;
}
.configuration-test {
margin-left: 40px;
}
.configuration-class {
margin-left: 60px;
}
.configuration-method {
margin-left: 80px;
}
.test-method {
margin-left: 100px;
}
.chronological-class {
background-color: skyblue;
border-style: solid;
border-width: 0 0 1px 1px;
}
.method-start {
float: right;
}
.chronological-class-name {
padding: 0 0 0 5px;
color: #008;
}
.after, .before, .test-method {
font-family: monospace;
font-size: 14px;
}
.navigator-suite-header {
font-size: 22px;
margin: 0 10px 5px 0;
background-color: #deb887;
text-align: center;
}
.collapse-all-icon {
padding: 5px;
float: right;
}
/*retro Theme*/
$(document).ready(function() {
$('a.navigator-link').on("click", function() {
// Extract the panel for this link
var panel = getPanelName($(this));
// Mark this link as currently selected
$('.navigator-link').parent().removeClass('navigator-selected');
$(this).parent().addClass('navigator-selected');
showPanel(panel);
});
installMethodHandlers('failed');
installMethodHandlers('skipped');
installMethodHandlers('passed', true); // hide passed methods by default
$('a.method').on("click", function() {
showMethod($(this));
return false;
});
// Hide all the panels and display the first one (do this last
// to make sure the click() will invoke the listeners)
$('.panel').hide();
$('.navigator-link').first().trigger("click");
// Collapse/expand the suites
$('a.collapse-all-link').on("click", function() {
var contents = $('.navigator-suite-content');
if (contents.css('display') == 'none') {
contents.show();
} else {
contents.hide();
}
});
});
// The handlers that take care of showing/hiding the methods
function installMethodHandlers(name, hide) {
function getContent(t) {
return $('.method-list-content.' + name + "." + t.attr('panel-name'));
}
function getHideLink(t, name) {
var s = 'a.hide-methods.' + name + "." + t.attr('panel-name');
return $(s);
}
function getShowLink(t, name) {
return $('a.show-methods.' + name + "." + t.attr('panel-name'));
}
function getMethodPanelClassSel(element, name) {
var panelName = getPanelName(element);
var sel = '.' + panelName + "-class-" + name;
return $(sel);
}
$('a.hide-methods.' + name).on("click", function() {
var w = getContent($(this));
w.hide();
getHideLink($(this), name).hide();
getShowLink($(this), name).show();
getMethodPanelClassSel($(this), name).hide();
});
$('a.show-methods.' + name).on("click", function() {
var w = getContent($(this));
w.show();
getHideLink($(this), name).show();
getShowLink($(this), name).hide();
showPanel(getPanelName($(this)));
getMethodPanelClassSel($(this), name).show();
});
if (hide) {
$('a.hide-methods.' + name).trigger("click");
} else {
$('a.show-methods.' + name).trigger("click");
}
}
function getHashForMethod(element) {
return element.attr('hash-for-method');
}
function getPanelName(element) {
return element.attr('panel-name');
}
function showPanel(panelName) {
$('.panel').hide();
var panel = $('.panel[panel-name="' + panelName + '"]');
panel.show();
}
function showMethod(element) {
var hashTag = getHashForMethod(element);
var panelName = getPanelName(element);
showPanel(panelName);
var current = document.location.href;
var base = current.substring(0, current.indexOf('#'))
document.location.href = base + '#' + hashTag;
var newPosition = $(document).scrollTop() - 65;
$(document).scrollTop(newPosition);
}
function drawTable() {
for (var i = 0; i < suiteTableInitFunctions.length; i++) {
window[suiteTableInitFunctions[i]]();
}
for (var k in window.suiteTableData) {
var v = window.suiteTableData[k];
var div = v.tableDiv;
var data = v.tableData
var table = new google.visualization.Table(document.getElementById(div));
table.draw(data, {
showRowNumber : false
});
}
}
body {
background-color: whitesmoke;
margin: 0 0 5px 5px;
}
ul {
margin-top: 10px;
margin-left:-10px;
}
li {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
padding:5px 5px;
}
a {
text-decoration: none;
color: black;
font-size: 14px;
}
a:hover {
color:black ;
text-decoration: underline;
}
.navigator-selected {
/* #ffa500; Mouse hover color after click Orange.*/
background:#027368
}
.wrapper {
position: absolute;
top: 60px;
bottom: 0;
left: 400px;
right: 0;
margin-right:9px;
overflow: auto;/*imortant*/
}
.navigator-root {
position: absolute;
top: 60px;
bottom: 0;
left: 0;
width: 400px;
overflow-y: auto;/*important*/
}
.suite {
margin: -5px 10px 10px 5px;
background-color: whitesmoke ;/*Colour of the left bside box*/
}
.suite-name {
font-size: 24px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;/*All TEST SUITE*/
color: white;
}
.main-panel-header {
padding: 5px;
background-color: #027368; /*afeeee*/;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color:white;
font-size: 18px;
}
.main-panel-content {
padding: 5px;
margin-bottom: 10px;
background-color: #CCD0D1; /*d0ffff*/; /*Belongs to backGround of rightSide boxes*/
}
.rounded-window {
border-style: dotted;
border-width: 1px;/*Border of left Side box*/
background-color: whitesmoke;
border-radius: 10px;
}
.rounded-window-top {
border-top-right-radius: 10px 10px;
border-top-left-radius: 10px 10px;
border-style: solid;
border-width: 1px;
overflow: auto;/*Top of RightSide box*/
}
.light-rounded-window-top {
background-color: #027368;
padding-left:120px;
border-radius: 10px;
}
.rounded-window-bottom {
border-bottom-right-radius: 10px 10px;
border-bottom-left-radius: 10px 10px;
overflow: auto;/*Bottom of rightSide box*/
}
.method-name {
font-size: 14px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: bold;
}
.method-content {
border-style: solid;
border-width: 0 0 1px 0;
margin-bottom: 10px;
padding-bottom: 5px;
width: 100%;
}
.parameters {
font-size: 14px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.stack-trace {
white-space: pre;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 12px;
font-weight: bold;
margin-top: 0;
margin-left: 20px; /*Error Stack Trace Message*/
}
.testng-xml {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.method-list-content {
margin-left: 10px;
}
.navigator-suite-content {
margin-left: 10px;
font: 12px 'Lucida Grande';
}
.suite-section-title {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
font-weight:bold;
background-color: #8C8887;
margin-left: -10px;
margin-top:10px;
padding:6px;
}
.suite-section-content {
list-style-image: url(bullet_point.png);
background-color: whitesmoke;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
overflow: hidden;
}
.top-banner-root {
position: absolute;
top: 0;
height: 45px;
left: 0;
right: 0;
padding: 5px;
margin: 0 0 5px 0;
background-color: #027368;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 18px;
color: #fff;
text-align: center;/*Belongs to the Top of Report*//*Status: - Completed*/
}
.top-banner-title-font {
font-size: 25px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
padding: 3px;
float: right;
}
.test-name {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 16px;
}
.suite-icon {
padding: 5px;
float: right;
height: 20px;
}
.test-group {
font: 20px 'Lucida Grande';
margin: 5px 5px 10px 5px;
border-width: 0 0 1px 0;
border-style: solid;
padding: 5px;
}
.test-group-name {
font-weight: bold;
}
.method-in-group {
font-size: 16px;
margin-left: 80px;
}
table.google-visualization-table-table {
width: 100%;
}
.reporter-method-name {
font-size: 14px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.reporter-method-output-div {
padding: 5px;
margin: 0 0 5px 20px;
font-size: 12px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
border-width: 0 0 0 1px;
border-style: solid;
}
.ignored-class-div {
font-size: 14px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.ignored-methods-div {
padding: 5px;
margin: 0 0 5px 20px;
font-size: 12px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
border-width: 0 0 0 1px;
border-style: solid;
}
.border-failed {
border-radius:2px;
border-style: solid;
border-width: 0 0 0 10px;
border-color: #F20505;
}
.border-skipped {
border-radius:2px;
border-style: solid;
border-width: 0 0 0 10px;
border-color: #F2BE22;
}
.border-passed {
border-radius:2px;
border-style: solid;
border-width: 0 0 0 10px;
border-color: #038C73;
}
.times-div {
text-align: center;
padding: 5px;
}
.suite-total-time {
font: 16px 'Lucida Grande';
}
.configuration-suite {
margin-left: 20px;
}
.configuration-test {
margin-left: 40px;
}
.configuration-class {
margin-left: 60px;
}
.configuration-method {
margin-left: 80px;
}
.test-method {
margin-left: 100px;
}
.chronological-class {
background-color: #CCD0D1;
border-width: 0 0 1px 1px;/*Chronological*/
}
.method-start {
float: right;
}
.chronological-class-name {
padding: 0 0 0 5px;
margin-top:5px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #008;
}
.after, .before, .test-method {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
margin-top:5px;
}
.navigator-suite-header {
font-size: 18px;
margin: 0px 10px 10px 5px;
padding: 5px;
border-radius: 10px;
background-color: #027368;
color: white;
font-weight:bold;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
text-align: center; /*All Suites on top of left box*//*Status: -Completed*/
}
.collapse-all-icon {
padding: 3px;
float: right;
}
.button{
position: absolute;
margin-left:500px;
margin-top:8px;
background-color: white;
color:#027368;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight:bold;
border-color:#027368;
border-radius:25px;
cursor: pointer;
height:30px;
width:150px;
outline: none;
}
/*Author: - Akhil Gullapalli*/
\ No newline at end of file
window.onload = function () {
let cookies = document.cookie;
let cookieValue = cookies.split('=');
if (cookieValue[1] === 'null' || localStorage.getItem('Theme') === 'null') {
document.getElementById('retro').setAttribute('disabled', 'false');
} else if (cookieValue[1] === 'Switch Ultra Theme' ||
localStorage.getItem('Theme') === 'Switch Ultra Theme') {
document.getElementById('button').innerText = "Switch Retro Theme";
document.getElementById('retro').setAttribute('disabled', 'false');
} else if (cookieValue[1] === 'Switch Retro Theme' ||
localStorage.getItem('Theme') === 'Switch Retro Theme') {
if (cookieValue[1] === 'Switch Ultra Theme' ||
localStorage.getItem('Theme') === 'Switch Ultra Theme') {
document.getElementById('button').innerText = "Switch Retro Theme";
document.getElementById('retro').setAttribute('disabled', 'false');
document.getElementById('button').innerText = "Switch Ultra Theme";
document.getElementById('retro').removeAttribute('disabled');
document.getElementById('ultra').setAttribute('disabled', 'false');
localStorage.setItem('Theme', select);
} else if (select === 'Switch Ultra Theme') {
document.getElementById('button').innerText = "Switch Retro Theme";
document.getElementById('ultra').removeAttribute('disabled');
document.getElementById('retro').setAttribute('disabled', 'false');
localStorage.setItem('Theme', select);
}
} else if (cookieValue[1] === 'Switch Retro Theme' ||
localStorage.getItem('Theme') === 'Switch Retro Theme') {
document.getElementById('button').innerText = "Switch Ultra Theme";
document.getElementById('ultra').setAttribute('disabled', 'false');
}
}
document.getElementById('button').onclick = function () {
let select = document.getElementById('button').innerText;
if (select === 'Switch Retro Theme') {
let d = new Date();
days = 365;
d.setTime(+d + (days * 86400000)); //24 * 60 * 60 * 1000
document.cookie = "Theme =" + select + "; expires=" + d.toGMTString() + ";";
document.getElementById('button').innerText = "Switch Ultra Theme";
document.getElementById('retro').removeAttribute('disabled');
document.getElementById('ultra').setAttribute('disabled', 'false');
localStorage.setItem('Theme', select);
} else if (select === 'Switch Ultra Theme') {
let d = new Date();
days = 365;
d.setTime(+d + (days * 86400000)); //24 * 60 * 60 * 1000
document.cookie = "Theme =" + select + "; expires=" + d.toGMTString() + ";";
document.getElementById('button').innerText = "Switch Retro Theme";
document.getElementById('ultra').removeAttribute('disabled');
document.getElementById('retro').setAttribute('disabled', 'false');
localStorage.setItem('Theme', select);
}
}
//Function to mouse hovering affect.
document.getElementById('button').onmouseover = function () {
document.getElementById('button').style.borderRadius = "25px";
document.getElementById('button').style.width = "180px";
document.getElementById('button').style.height = "45px";
document.getElementById('button').style.marginTop = "1px";
}
//Function to mouse out affect
document.getElementById('button').onmouseout = function () {
document.getElementById('button').style.borderRadius = "25px";
document.getElementById('button').style.width = "150px";
document.getElementById('button').style.height = "30px";
document.getElementById('button').style.marginTop = "8px";
}
//This is the file where we handle the switching of the Themes.
/*Author:- Akhil Gullapalli*/
<?xml version="1.0" encoding="UTF-8"?>
<testng-results ignored="0" total="2" passed="2" failed="0" skipped="0">
<reporter-output>
</reporter-output>
<suite started-at="2026-05-04T16:17:07 ICT" name="Surefire suite" finished-at="2026-05-04T16:17:30 ICT" duration-ms="23048">
<groups>
</groups>
<test started-at="2026-05-04T16:17:07 ICT" name="Surefire test" finished-at="2026-05-04T16:17:30 ICT" duration-ms="23048">
<class name="com.automation.testcases.BasicWebDriverCommandsTest">
<test-method is-config="true" signature="setUp()[pri:0, instance:com.automation.testcases.BasicWebDriverCommandsTest@75f32542]" started-at="2026-05-04T16:17:07 ICT" name="setUp" finished-at="2026-05-04T16:17:08 ICT" duration-ms="1615" status="PASS">
<reporter-output>
</reporter-output>
</test-method> <!-- setUp -->
<test-method signature="testBasicCommands()[pri:0, instance:com.automation.testcases.BasicWebDriverCommandsTest@75f32542]" started-at="2026-05-04T16:17:08 ICT" name="testBasicCommands" finished-at="2026-05-04T16:17:20 ICT" duration-ms="11764" status="PASS">
<reporter-output>
</reporter-output>
</test-method> <!-- testBasicCommands -->
<test-method is-config="true" signature="tearDown()[pri:0, instance:com.automation.testcases.BasicWebDriverCommandsTest@75f32542]" started-at="2026-05-04T16:17:20 ICT" name="tearDown" finished-at="2026-05-04T16:17:20 ICT" duration-ms="365" status="PASS">
<reporter-output>
</reporter-output>
</test-method> <!-- tearDown -->
</class> <!-- com.automation.testcases.BasicWebDriverCommandsTest -->
<class name="com.automation.testcases.WebElementCommandsTest">
<test-method is-config="true" signature="setUp()[pri:0, instance:com.automation.testcases.WebElementCommandsTest@5276e6b0]" started-at="2026-05-04T16:17:20 ICT" name="setUp" finished-at="2026-05-04T16:17:22 ICT" duration-ms="1103" status="PASS">
<reporter-output>
</reporter-output>
</test-method> <!-- setUp -->
<test-method signature="testFindAndInteractWithElements()[pri:0, instance:com.automation.testcases.WebElementCommandsTest@5276e6b0]" started-at="2026-05-04T16:17:22 ICT" name="testFindAndInteractWithElements" finished-at="2026-05-04T16:17:29 ICT" duration-ms="7989" status="PASS">
<reporter-output>
</reporter-output>
</test-method> <!-- testFindAndInteractWithElements -->
<test-method is-config="true" signature="tearDown()[pri:0, instance:com.automation.testcases.WebElementCommandsTest@5276e6b0]" started-at="2026-05-04T16:17:29 ICT" name="tearDown" finished-at="2026-05-04T16:17:30 ICT" duration-ms="176" status="PASS">
<reporter-output>
</reporter-output>
</test-method> <!-- tearDown -->
</class> <!-- com.automation.testcases.WebElementCommandsTest -->
</test> <!-- Surefire test -->
</suite> <!-- Surefire suite -->
</testng-results>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment