Sahi Pro - What is new in Sahi Pro v6.1.0
abstract Sahi Pro v6.1.0 is a major release and contains many new features and bugfixes.
warning There are some changes in Sahi's behaviour in this release which need changes in usage. Please go through the Changes needed in Usage section for details.
If you wish to store your reports in MySQL, MSSQL or Oracle databases, you can do so by performing some post installation steps.
Please refer to MySQL, MSSQL and Oracle sections for details.
info IMPORTANT: Please note that from SahiPro 6.1.0 onwards, you do not need to run db queries manually for any database, for a fresh installation.
warning Upgrading to SahiPro 6.1.0 is easier than before. Please refer to Upgrade Sahi section for details.
developers to write their own custom tags and define the tag's behaviour.
This unfortunately breaks how most tools traverse the DOM to identify elements.
Sahi Pro 6.1.0 supports identification and recording of elements in ShadowDOM and custom HTML elements.
This is based on the new ShadowDOM and custom HTML element support.
Working with Polymer Elements
Polymer Accessor APIs
Check Errors in Scripts for more details.
Enter the text to be searched and select if you want to specifically search for a function or variable. If both are left unchecked, both will be searched.
You can also specify the types of file you want to search in.
If you want to replace the searched text, simply put the replacment in the 'Replace with' text box and select the files in which text should be replaced. Click on Replace button.
Please refer to the Find and Replace section for more details.
A red dot appears signifying the breakpoint. If you execute this script from the editor, Sahi will pause the script at the breakpoint and launch the controller.
You can then step through the script to debug the behaviour.
Clear Break Pointscan be used to clear the break points of all scripts.
Check Debugging Sahi Scripts for more details.
Please refer to Scenario Editor for more details.
Sample scenario files have been changed to reflect the new format.
Refer to Sync Reports to Central Database section for more details.
Send Email Reportssection in Editor Advanced Playback Settings.
storing reports in Oracle for more details.
In versions prior to SahiPro 6.1.0, the entire scripts folder would get synced to different nodes. As of this release, we only sync the scripts necessary to execute a run. Please refer to Smart zip for more details.
Distribute scripts in rotation
Distribution of scripts across nodes has now been made more even. Please refer to Scripts rotation for more details.
Ability to specify Threads
Previously, the number of browsers running on a Node in a distributed run could only be controlled by the Capacity of the browser, mentioned in browser_types.xml.
As of this release, it is possible to specify Threads for a distributed run. The minimum of Threads and Capacity will determine the number of browsers to run in parallel.
The nodes participating in a distributed run are now monitored internally for health. Please refer to Nodes monitoring to understand how this makes the run better.
Ability to register Nodes externally
It is now possible to register additional node(s) in the middle of a long running distributed run and share the workload.
Refer to Registering external nodes for details.
- _resource: API to include external resource files like csvs, excel files, images, in distributed runs.
- _positionNative: Returns the position of an element relative to screen.
Script Execution Control APIs
- _byPassWaitMechanism: When set to true, script will not use the Sahi wait mechanism. Use with caution.
- _fileExists: Returns true if file exists, else false.
Data Drive related APIs
- getDataForDataDrive: _getExcel().getDataForDataDrive() API has been added which returns data in a format appropriate for passing into _dataDrive.
_getExcel().getData() should NOT be used with _dataDrive.
Script/Suite Info APIs
- _testcasesInfo: Returns an array of testcase-property objects of the executed testcases.
- _setSpeed: This API has been modified to work at a script level. Using this in one script will not affect the behaviour of other scripts.
- _areEqual: This API has been fixed to work correctly in an if condition. Earlier it could be used only inside an Assertion API.
_assertSnapShot, _compareImages, _assertEqualImages: The difference threshold has been changed to float instead of int. Existing scripts do not need to change.
- _readExcelFile: This API takes an extra parameter $ignoreEmptyRows. If not specified, it defaults to false which means that empty rows will be returned. Existing scripts do not need to change.
- Editor Metadata implementation revamped. Earlier implementation caused OutOfMemory errors in some scenarios.
- Editor Context panel displays Sahi APIs along with arguments.
- Editor: If a function is present in multiple files, it is shown only once in the Function Name dropdown in the Context panel. User can choose the appropriate library file to include the correct function. Similar behaviour is applicable for Accessor Repository keys as well.
- Editor: In a scenario file, auto complete of a function shows only one entry for a function name, if it is present in multiple library files. The correct file to include can be chosen from Function Details.
- Editor: Cut, Copy and Paste of files and folders, implemented in Editor.
- Editor: Added ability to traverse forward and back in Editor, based on scripts opened through function lookup in Context editor
- Editor: Shortcuts added in Editor for comments, adding duplicate line of code, removing a line of code, etc.
Close Othersoptions added for closing scripts.
- Editor: File or folder rename automatically changes all includes in containing scripts, and script definitions in suites.
- Editor: Added Refresh Metadata icon in Context panel.
- Editor: Added
Insert + Enterbutton in Context panel, to end line with semicolon and go to next line.
- Users can now view plain CSV and Excel files in the Editor.
- Editor: Added "Expand All" and "Collapse All" in Navigator.
Mailer functionality has been enhanced.
- Users can now send emails with attachments.
- More APIs have been added in Mailer class. Please refer to Sending Emails for more details.
- WebSockets are now correctly handled. HTTPS sites with non 443 ports may break in very rare cases. Such sites need to be added to
- Scripts for applications running inside Chromium Embedded Framework can be recorded and executed. Refer to Chromium Embedded Framework for more details.
- Single machine run also goes through the same underlying framework as Distributed runs, but scripts are not synced to
temp/copied/scriptsfolder. The Suite Report will show localhost in the Nodes Info. In previous releases, Nodes Info would be blank.
- Added SahiEndPoint.java. This exposes all the APIs needed for external code to integrate with Sahi functionality. Updated the Sahi Integration Support document as well.
- Updated h2 jar to version 1.3.159. This speeds up SQL selects considerably.
- force_inject.txt added for forcing injection in specific cases where full html is fetched via AJAX and written using document.write.
- Added pass_through_urls.txt to transparently pass through content.
- ConfigureUI: Added brief description of each Configuration file at the top of each file.
- Added force_inject and pass_through_urls to ConfigureUI
- Added support for handling PATCH request.
- _dataDrive will ignore a row, if it starts with //
- Logs: For a scenario run, Expand All will expand the Sahi functions as well.
- Added diagnostics.sah to show information regarding Sahi, OS and browser in the logs. Users can include this script when running the suite. This gives the ability to check diagnostic information for a suite that was run in the past.
- When a log is opened, the suite or script name is set as the title for the browser page.
- Documentation: Added global search bar which helps in searching for items across different headings.
- Template of email sent after a suite, has been modified. Information added for TestCases.
- Failed scripts suite is created in the Initiator scripts folder in "drun different master" scenario.
- ANT xml Retry targets have been changed for drun and drun different master scenarios.
- Simplified ANT and batch file parameters used in drun and drun different master scenarios
- Added proxy.host to sahi.properties. This setting helps in cases where isHostTheProxy fails to identify the proxy properly.
- Added support for downloading blob content (HTML5 Blob object).
- Added pointer events for IE-10 and IE-11
- _readCSVFile also returns associative Array to be consistent with _readExcelFile. No change needed in existing code.
- Testcase counts are shown in suite report logs.
[ReturnValue]keyword added in Excel Framework to access value returned by previous step.
Show clientX and clientYfunctionality works on CTRL+SHIFT+mouseover, instead of CTRL+mouseover.
- Suites running for more than 50 minutes would show up as RUNNING. If email were to be configured for the run, the email would go before the end of the run. Fixed.
- Added checks to prevent _sahi from being initialised twice. Can happen if injection happens multiple times (partials fetched by AJAX and written using document.write)
- _getValue was not showing correct error message if the element passed was not found. Fixed.
- Editor: Search is no longer case sensitive.
- Editor: If a file was saved as an existing file that was already open, the contents were not being updated. Fixed.
- Editor Context Panel: Fixed incorrect removal of spaces from arguments during Update and Insert
- Editor Context Panel: Update of inner function call fixed.
- Editor Context Panel: Fix to quote urls in Arguments correctly
- Editor Context Panel: Loading AR values only for AR like keys ($_TEXTBOX and not $abcd)
- Editor Context Panel: If the entire function text matching a dropdown value were to be typed, arguments were not being updated. Fixed.
- Editor Context Panel: If arguments are left blank, Update will remove null arguments at the end, but add null arguments otherwise.
- Editor Context Panel: Added check to not quote function arguments which are themselves functions.
- Editor Playback window height will now remain fixed.
- Editor: Fixed bug in editor to stop loading tab contents 2 times.
- Editor: Removed extra server calls to save Editor history.
- Editor: Modified .suite files would not show *. Fixed.
- Editor: Content of open tabs loaded only when tab is selected.
- Editor: History for unselected logs info elements was not getting saved correctly. Fixed.
- Editor loading optimized.
- Editor: Tabs are opened from history only for scripts matching the scripts directory.
- Editor: Hide "Show Context", "Create Function", "View Doc" buttons for Suite files.
- Editor Navigator filter showed only .sah files on selecting "Scripts" and .suite files on selecting "Suites" from dropdown. Now it will show .sah, .sahi, .js, .s.csv, .xls, .xlsx files on selecting "Scripts" and .suite, .dd.csv files on selecting "Suites"
- Editor: Sometimes, script refresh causes blank content to appear. Fixed.
- Editor: When a loadSahi or loadExcel line is added or removed, the scenario metadata should be refreshed. Fixed.
- Editor: Erratic Context function metadata behaviour fixed.
- Editor: Choosing New -> Script, and pressing Ctrl + S now opens the Save As dialog.
- Editor: Navigator now shows Folders first and then Files.
- Editor: If "Link with Editor" was chosen in the Navigator and a new file was created, it was not linked in the Navigator. Fixed.
- Editor: When a new data driven suite is created, the columns #script, url and tags are added by default.
- Editor: In a scenario file, a double quoted cell value was not copied correctly to a different cell. Fixed.
- Editor: Undo-Redo functionality did not work well in Scenario files. Fixed.
- Editor: Empty lines at the end of a scenario file are not saved anymore.
- Editor: Opening a spreadsheet that had a TAB character caused problems. Fixed.
- Editor: "Create Suite" link should save with [.suite] extension by default. Fixed.
- Editor: In the Playback window, closing the alert for empty browser and start url fields, would cause the Playback window to be closed. Fixed.
- Intermediate zip files created in distributed run scenarios were not being deleted at times. Fixed.
- Update of offline logs would sometimes throw FileNotFoundException. Fixed.
- Flex: After _click is performed on a MxComponent Element (for example: Button), the element still appeared dark (as if Mouse was still pressed on that Button). Fixed.
- Playback with !tag matching was broken. Fixed.
- Controller: Corrected areWindowsLoaded functionality for Diagnose.
- Added trycatch for xhr check to handle Permission Denied errors.
- Fixed recording of "Enter" based form submits.
- Controller: Recorded steps data now scrolls to the bottom to show latest steps.
- Controller Playback: If a script was run without checking the Start URL checkbox, and an error was encountered in the first step, rerunning the script would do nothing. Fixed.
- PacProxySelector changes - Multiple bugs (shExpMatch, isInNet, myIpAddress) in pacFunctions.js fixed.
- Single quote in url breaks proxy pac. Fixed.
- Added --enable-npapi while launching chrome to enable java after chrome 42. Needed for supporting Applets.
- dataTransfer set to null for Firefox versions greater than 30. Fixes simple drag drop on Firefox. Complex cases may need _dragDropNative
- In all screenshot APIs that did image comparison, the difference threshold has been changed to float instead of int. Existing scripts do not need change.
- _assertEqualImages: If the actual and expected images have the same name but are from different directories, the expected image is compared with itself instead of the actual image. Fixed.
- In offline logs, Show Retry logs link should be displayed only when there is a failure. Fixed.
- Url added to donot_download_urls.txt does not prevent the download, if content disposition forces download. Fixed.
- If IE has an external proxy, starting and stopping Sahi without ever launching IE, will cause external proxy to be deleted from IE. Fixed.
- Comparing screenshots between two Report logs should not display images from _assertEqualImages step. Fixed.
- Changes to use 127.0.0.1 instead of localhost for proxy lookup in IE, Firefox and Chrome. Fixes Firefox random failures due to DNS lookup errors.
- Controller: Fixed step wise playback from controller
- Controller: When recording a script, clicking on "Append to Script" will cause appended steps to appear in result textarea.
- "Stop All" functionality will close all running scripts as well.
- _windowAction API fails for Sahi installations with space in their path. Fixed.
- Corrected _lock, _unlock documentation to reflect latest functionality.
- Added changes to create SSL socket with getHostAddress() instead of getHostName(). Fixed slow running script on a https URL on mobile device.
- _launchNewBrowser was using the same pool as the launching browser which led to capacity exhaustion for the browser type. Now it uses a different pool with the same capacity as that of the launching browser.
- Added support for response stream with gzip encoding in REST APIs.
- Disabled firefox data reporting
- Added junit suite report as part of offline logs.
- Logs: Removed "Pass threshold" from Suites list, since it was not being used.
- _openBrowser resets domain and window contexts.
- Scenario Files: global setup and teardown are called before and after each testcase block.
If using data drive, local setup and teardown are called after each line of data.
- setup and teardown are shown grouped in logs
- mail.isSSL in email.properties was not used correctly which caused non SSL connections to fail. Fixed.
- One could not run Data driven suites (.dd.csv) on mobile devices. Fixed.
warning This section assumes that you have already been using Sahi. It lists changes in Sahi's behaviour in SahiPro 6.1.0.
In a distributed run, only the participating scripts in the suite are zipped and sent over to the nodes.
Hence if your scripts refer to any resources like CSV files (through CSV APIs)
or Excel files (through Excel APIs) or images etc, they have to be explicitly included in your
scripts using the _resource API.
Please use relative path for resources so that they can work on all the nodes.
In summary, any resource that your script uses (other than scripts themselves), needs to be included through _resource APIs.
The ANT xmls have changed. Please regenerate the ANT xml files used in your continuous integration systems, from the Playback Editor.
The old ANT xmls may or may not work, so please use the new versions.
- Accessors metadata location has changed.
accessors_applet.metadata.txthave been removed from
The default values for accessor identification have been moved in to
config/accessor_metadata/as .json files.
To customize accessors, please refer to Tweaking Sahi APIs for details.
info NOTE: If you have not modified Accessor metadata in your previous versions, no changes are required.
APIs declared via accessor metadata need not be defined again in normal_functions.txt.
warningnormal_functions.txt should not be modified by end user.
- APIs declared via accessor metadata need not be defined again in normal_functions.txt.
- Reports xsl location has changed.
The default report XSL files which are shipped with Sahi have now been moved into
The XSLs have been modified significantly to reflect database changes.
If you have customized these xsls previously, create a copy in
userdata/config/reports/xxxfolder and apply your changes in this copy.
Refer to Modifying an existing reporting type section for details.
info NOTE: If you have not customized any xsls in your previous versions, no changes are required.
A very early form of TestRunner usage using browser path, browser exe, as shown below, has been removed. Please use testrunner.bat instead.
java -cp /path/to/ant-sahi.jar net.sf.sahi.test.TestRunner <test_or_suite_name> <browser_executable> <start_url> <log_dir> <sahi_host> <sahi_port> <number_of_threads> <browser_executable> [<browser_option>]
In the Editor, Context Panel information is populated by Ctrl + Click on a line. Earlier, this would happen on Click.
If you had received patches from us for a previous version, please refer to Post Upgrade steps for all installations section for details on how to deal with