0% found this document useful (0 votes)
6 views15 pages

Ste Report

The document presents a project report on an automated testing tool named Sahi, developed by a group of four students at S.M.D.R. Government Polytechnic, Dhule for the academic year 2022-2023. It outlines the features, advantages, and operational mechanisms of Sahi, emphasizing its efficiency in web application testing compared to other tools like Selenium. The report concludes that Sahi is a superior choice for automation due to its simplicity, speed, and robust functionality.

Uploaded by

Komal Jadhav
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)
6 views15 pages

Ste Report

The document presents a project report on an automated testing tool named Sahi, developed by a group of four students at S.M.D.R. Government Polytechnic, Dhule for the academic year 2022-2023. It outlines the features, advantages, and operational mechanisms of Sahi, emphasizing its efficiency in web application testing compared to other tools like Selenium. The report concludes that Sahi is a superior choice for automation due to its simplicity, speed, and robust functionality.

Uploaded by

Komal Jadhav
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/ 15

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

S.M.D.R. GOVERNMENT POLYTECHNIC, DHULE


(0017)

Program Name and Code : CO-5I


Course Name and Code : STE(22518)
Academic Year : 2022-2023
Semester : Fifth [5th]

Project on-
AUTOMATED TESTING TOOL - SAHI

Submitted on 2022 by the group of 04 students.

Sr. No. Name of student Enrollnment No. Roll no

1. Jadhav Komal Suresh 2000170104 307

2. Thakare Sakshi Bapu 2000170106 309

3. Targe Prachi Rajesh 2100170150 350

4. Jathar Krushna Arvind 2000170163 363


MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION
Certificate

This is to certify that Master /Ms …………………………………………………………..


Roll No:- …………………………………of 5th Semester of Diploma in Computer
Engineering of Institute, S.M.D.R. Government Polytechnic, Dhule (Code:0017) has
completed the STE Project satisfactorily in the Subject –STE for the Academic Year 2022 -
2023 as prescribed in the curriculum.

Place : Dhule Enrollment No : …………………………………..


Date : …………… Exam. Seat No : ……………………………………

Subject Teacher Head of the Department Principal

Seal of
Institution
S.M.D.R GOVTERNMENT POLYTECHNIC
DHULE

-SUBMISSION-
I am …………………………………………………………………………………
Roll No.- …………………………………………………….as a student of 5th
Sem/Year of the Programme Computer Engineering humbly submit that I have
completed from time to time the Practical/Micro-Project work as described in this
report by my own skills and study between the period from ……………………… to
…………………….. as per instructions/guidance of prof. …………….
And that following students were associated with me for this work, however,
quantum of my contribution has been approved by the Lecturer.
And that I have not copied the report on its any appreciable part from any other
literature in contravention of the academic ethics.

Date: ……/…../2022 Signature of Student


ACKNOWLEDGEMENT

The success and final outcome of this project required a lot of guidance and
assistance from many people and we are extremely privileged to have got this all
along the completion of our project. All that we have done is only due to such
supervision and assistance and we would not forget to thank them.

We respect and thank Dr. Mr. R. G. Wadekar, Principal, S.M.D.R. Government


Polytechnic, Dhule for providing us an opportunity to do the project work in the
institute and giving us all support and guidance which made us complete the project
duly. We are extremely thankful to Mr. Wadekar Sir for providing such a nice support
and guidance.

We heartily thank Mr. Deshmukh, Head, Department of Science and


Humanities, for his guidance, suggestions and encouragement during this project
work.

We own our deep gratitude to our project guide prof . Akshay Pakhare Sir, who
took keen interest on our project work and guided us all along, till the completion of
our project work by providing all the necessary information for developing a good
system.

We are thankful to and fortunate enough to get constant encouragement, support


and guidance from all the Teaching staffs of Department of Science and Humanities
which helped us in successfully completing our project work.
TABLE OF CONTENT

NO. CONTENT

1. ABSTRACT

2. INTRODUCTION

3. WHY SAHI ?

4. KEY FEATURES

5. HOW SAHI WORKS ?

6. ADVANTAGES AND DISADVANTAGE

7. SUMMARY

8. CONCLUSION
ABSTRACT

Web testing is the process of testing the applications hosted on the web in which the
application interfaces and functionalities are tested. Testing the application before
going to live will resolve many issues. Generally, more than 80% of the verification
process are repetitive, with testers performing the same verification steps manually
from release to release.

Manual testing is a time consuming process but cannot be overlooked because each
time a software doesn't perform well according to the specifications. Test automation
tests the application using special software. The primary objective of test automation
is to reduce repetitive manual tasks. There are many commercial tools and open
source frameworks available for automated testing of web applications. This paper
introduces the new automation tool named Sahi and also shows the comparison with
Selenium. Both the mentioned tools are used to automate web applications and the
comparison shows the better choice of automation tool.
INTRODUCTION

Sahi is an automation and testing tool for web applications. It is available in


both open-source and proprietary versions. The open-source version includes record
and playback on all browsers, HTML reports, suites and batch run and parallel
playback, etc. Pro version includes some of the enhanced features like test distribution
and report customization. While considering the technical the proxy settings are
configured to point to a Sahi's proxy and then injects JavaScript event handlers into
web pages.

Sahi Pro is a test automation software for desktop applications, mobile


applications and web applications. Sahi was conceived as an open source product in
2005 with specific focus on test automation management tools for web 2.0
technologies but as a test automation tool geared towards testers. Sahi Pro is shipped
proprietary license software . The open-source version includes a basic tools set
sufficient for most testing purposes Record on all browsers, Playback on all browsers,
HTML playback reports, JUnit Style playback reports, Suites and batch run, Parallel
playback of tests, whereas the Pro version includes further features such as test
distribution and report customization.

Sahi is especially suited for cross-browser/multi-browser testing of complex


web 2.0 applications with lots of AJAX and dynamic content. Sahi works well in
Agile development environments, enabling rapid automation and maintenance and
easily integrating with build systems. Sahi saves time and effort with faster
development, less maintenance and fast distributed playback. Sahi runs on any
modern browser which supports javascript.
Sahi runs as a proxy server and the browser's proxy settings are configured to
point to Sahi's proxy. Sahi then injects JavaScript event handlers into web pages,
which allows it to record and playback events on the browser. Using a proxy makes
Sahi independent of the browser used.
WHY SAHI?
Contrasted with other latest automation testing tools, Sahi controller (IDE) can
be utilized as a part of different browsers.
Sahi’s APIs don’t depend much on the HTML structure. Sahi web automation
tool, does not utilize XPaths and has APIs like _near, _in and so forth to discover one
component in connection to another. Regardless of whether the structure of the page
changes, these work appropriately. Sahi automation tool documentation is useful in
managing the evolving pages of any website.

Getting Started

First of all, we can download the latest Sahi zip file from sourceforge. The
prerequisite for Sahi is JRE 1.4 or above.

• Unzip sahi.zip to a desired location.


• Navigate to bin to start sahi proxy server.
• Next, config the browser to use sahi proxy.

After finishing the setup, we can start creating scripts. The scripts can be written using
any text editor with the facility of recording by controller. Press ALT and double click
on the window, which you want to record.

The controller is as below:


Recording

• On the popup that appears, give a name for the script you wish to generate, and
click 'Record'
• Most actions on the page will now get recorded.
• Moving the mouse over any html element while pressing Ctrl key will show the
JavaScript accessor info in the popup.
• Clicking the "Add Assertions" button generates assertions for the element.
These assertions can be added to the script by clicking "Add to Script".The
script being generated can be viewed by opening the .sah file in the scripts
directory. The script can be edited even while recording, so that logical
segregation into functions etc. can be done while recording happens.
• Once done, click stop.

Note that custom code can be tested, by entering code in the "debug" text area and
clicking on "Test->". The command will be executed and the result will be displayed
in the textbox near the” Test->"button.

Once confirmed that the desired result has been achieved, that code snippet can be
added to the recording by clicking "Append to Recording".

Script Playback

• Open (alt-dblclick) the popup window.


• Select script file from the dropdown.
• Or go to the "[from url]" section and specify the full URL of the script file.
(e.g. http://proxyhost:proxyport/_s_/scrcipts/scriptName.sah)
• Click 'Set'.
• Wait for the pages to reload.
• Click 'Play'.

Test Suite

Multiple tests can be run through ant. For each test in the suite, the ant target opens a
browser, runs the test and closes the browser. The ant target specifies a suite file, say
SuiteName.

Data Driven Testing

Sahi has some inbuilt features for data driven testing. Sahi can read and write to CSV
(Comma Separated Value) files, databases and Excel sheets.

• _readCSVFile (csvFilePath) reads a CSV file and returns a two dimensional


array.
• _writeCSVFile (array2D, filePath) writes the two dimensional array into a file
in CSV format
KEY FEATURES

1. Super robust object identification mechanism and simple which works


crosswise over browsers.
▪ Sahi does not utilize CSS selectors or XPaths. It has its personal
wrappers around the Javascript DOM that are easy to utilize and simple
to keep up.
▪ Sahi works notwithstanding when components don’t have IDS.
▪ Sahi utilizes social APIs like _under, _leftOf, _in, _near,_rightOf and so
on to extraordinarily recognize components.

2. Great recorder and question spy which functions on Firefox, Chrome, Internet
Explorer, Safari, Opera.

3. Playback on any desktop browser and even on mobile phone browsers.

4. Sahi naturally crosses crosswise over iframes and frames.

5. Test automation Sahi can have different playback scripts at the same time
decreasing playback time.

6. Sahi consequently assembles rich reports without including any additional


code. This keeps the content simple with no messiness.

7. Sahi testing tool naturally waits for Ajax movement and page loads. There is no
requirement for including wait proclamations in 95% cases.

8. This decreases the code base size by half contrasted with different website
testing tools free and makes the scripts strong yet effortlessly viable.

9. Sahi does not require the browser to be in the center.

10. Sahi test underpins Shadow DOM and HTML5 custom tags.
11. Sahi Pro has a simple UI to assemble and test REST APIs

12. Sahi Pro can gauge Javascript code scope in your web applications.

13. Sahi Pro Desktop Add-on underpins automation of Java applications from a
similar script and Windows desktop applications.
HOW SAHI WORKS?

Sahi uses a small proxy server that runs on your machine. All the browser traffic goes
through this proxy and as a result, Sahi is able to inject JavaScript onto the web page.
That JavaScript allows you to do all the automation. This is similar to Selenium RC,
except that Sahi doesn’t rely on technologies like Xpath or CSS selectors. Instead, a
tester doesn’t need to know much about an application. Since the tool injects
JavaScript into the web page, there’s more control. Any element that is of interest to
automation will always have something to help identify it. A tester does not need to go
back to a developer for nearly as often. The tool itself figures out which elements it
needs to use to interact with a control. This makes the recorded elements stable in the
sense that they don’t change very often.
Sahi has simple and straight forward architecture and it is proxy between Java and
browser. Sahi is proxy between Java and the Browser.

Sahi proxy server is written in Java. It uses an HTTP proxy as its core to inject
javascript into web pages. The injected Javascript uses custom code to identify
elements in the browser and simulate the actions like click, type, etc... on them. Html
responses that pass through the proxy are modified such that Javascript is injected at
the start and the end of the response. Sahi Script uses the same constructs of
JavaScript, that adds the capability to interact with the browser efficiently.

Sahi's core parts include the Sahi proxy server and the JavaScript engine. HTML
responses which pass through the proxy are modified such that JavaScript is injected
at the start and the end of the response. This will allow the browser to record and
playback scripts and talk back to the proxy when needed. Apart from handling
requests for pages that the browser requests, Sahi also handles custom commands
related to recording, playback etc. which the browser sends.

Besides the normal features like supporting ant, Sahi has its own features, like good
support of database files, supporting JavaScript, AJAX and also the simple APIs.
ADVANTAGES & DISADVANTAGES

Advantages of Sahi automation tool:


▪ Utilizing SAHI testing tool tutorial wouldn’t cost you much as it saves both your
money and time.
▪ SAHI is one of the best web applications testing tools open source, so it is
accessible to everybody efficiently.
▪ Some testing tools will run just on particular browsers however SAHI keeps
running on all of the browsers.
▪ SAHI runs regression testing for the web application.
▪ SAHI scripts are quick to make and simple to keep up.
▪ SAHI playback is quick and dependable.
▪ One can without much of a stretch acquaint SAHI with manual analyzers.
▪ Instinctive and easy APIs.
▪ No, wait articulations required notwithstanding for AJAX and page loads.

Disadvantages of Sahi automation tool:


▪ Support for numerous languages: SAHI open source tutorial utilizes Javascript
as its base language. Lately, SAHI does not give you a chance to make your
test cases in different languages.

▪ Visibility: SAHI does not charge a similar visibility that Selenium does and it
takes somewhat longer to convince management and customers.

▪ The thing which we enjoyed the most about this Sahi tutorial is that the
installation procedure is simple for fresher testers, and it is easy to get
acquainted with the interface of this tool. We, at Test Origin simply run the site
and played out some record and playback activities for testing purposes. So,
overall the Sahi tool tutorial is easy to learn, and we can also utilize the scripts
for regression testing in future.
SUMMARY

▪ Sahi scripts are fast to create ,easy to maintain.


▪ Sahi plays back fast and reliably.
▪ Architecture is simple.
▪ Sahi takes care of plumbling.
▪ Teams need not be revamped.
▪ one can easily introduce manual testers to sahi automation.
CONCLUSION

Sahi is focused towards saving time for testers and developers. Sahi takes care of
reporting, handling suites, distributed playback across multiple machines, etc, with
minimal effort from the tester. In this paper, limitations of Selenium and uses of Sahi
over Selenium are shown. On the basis of analysis performed by considering the
aspects of Selenium limitations like AJAX loading, working with XPath,
multibrowser support and reporting functionality kind of things shows that automation
of web application can be better performed using Sahi over Selenium. While choosing
a good tool, performance is the most important factor to take into consideration rather
than the cost. We conclude that Selenium may be right for certain specific situation,
but SAHI can be the best choice in many more situations.

You might also like