18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Are the 78 API functions listed on Sahi Home Page all that we can use?

RobinLRandallRobinLRandall Members
edited February 2009 in Sahi - Open Source
I counted 115 "prototype" functions in concat.js and lib.js files in \spr directory.
For example, can we use "_re()" or "continueOnError()" ? If so, why are these not included as official APIs? (See below)

(Of course I know we can create our own functions, but why reinvent the wheel?)

Thanks,
RR

concat.js(0x1fe8): Sahi.prototype._dragDrop = function (draggable, droppable) {
concat.js(0x2118): Sahi.prototype._dragDropXY = function (draggable, x, y, isRelative) {
concat.js(0x2572): Sahi.prototype._isVisible = function (el) {
concat.js(0x289e): Sahi.prototype._click = function (el) {
concat.js(0x292c): Sahi.prototype._doubleClick = function (el) {
concat.js(0x29bf): Sahi.prototype._rightClick = function (el) {
concat.js(0x2a51): Sahi.prototype._mouseOver = function (el) {
concat.js(0x2b16): Sahi.prototype._keyPress = function (el, charCode, combo) {
concat.js(0x2d9b): Sahi.prototype._focus = function (el) {
concat.js(0x2df4): Sahi.prototype._keyDown = function (el, charCode, combo) {
concat.js(0x2ea6): Sahi.prototype._keyUp = function (el, charCode, combo) {
concat.js(0x2f56): Sahi.prototype._readFile = function (fileName) {
concat.js(0x2ffc): Sahi.prototype._getDB = function(driver, jdbcurl, username, password){
concat.js(0x41df): Sahi.prototype._highlight = function (el) {
concat.js(0x42a5): Sahi.prototype._position = function (el){
concat.js(0x4b22): Sahi.prototype._setValue = function (el, val) {
concat.js(0x505a): Sahi.prototype._setFile = function (el, v, url) {
concat.js(0x5de4): Sahi.prototype._setSelected = function (el, val, isMultiple) {
concat.js(0x60e2): Sahi.prototype._check = function (el, val) {
concat.js(0x614f): Sahi.prototype._button = function (n) {
concat.js(0x6204): Sahi.prototype._reset = function (n) {
concat.js(0x62b6): Sahi.prototype._submit = function (n) {
concat.js(0x636b): Sahi.prototype._wait = function (i, condn) {
concat.js(0x65df): Sahi.prototype._file = function (n) {
concat.js(0x663b): Sahi.prototype._textbox = function (n) {
concat.js(0x669a): Sahi.prototype._password = function (n) {
concat.js(0x66fe): Sahi.prototype._checkbox = function (n) {
concat.js(0x6762): Sahi.prototype._textarea = function (n) {
concat.js(0x67c9): Sahi.prototype._accessor = function (n) {
concat.js(0x680c): Sahi.prototype._byId = function (id) {
concat.js(0x6869): Sahi.prototype._byText = function (text, tag) {
concat.js(0x6903): Sahi.prototype._select = function (n) {
concat.js(0x69c1): Sahi.prototype._radio = function (n) {
concat.js(0x6a1f): Sahi.prototype._div = function (id) {
concat.js(0x6aaf): Sahi.prototype._span = function (id) {
concat.js(0x6b41): Sahi.prototype._spandiv = function (id) {
concat.js(0x6bc6): Sahi.prototype._label = function (id) {
concat.js(0x7267): Sahi.prototype._image = function (n) {
concat.js(0x72c4): Sahi.prototype._imageSubmitButton = function (n) {
concat.js(0x732e): Sahi.prototype._link = function (n) {
concat.js(0x7382): Sahi.prototype._simulateEvent = function (el, ev) {
concat.js(0x74db): Sahi.prototype._setGlobal = function (name, value) {
concat.js(0x7575): Sahi.prototype._getGlobal = function (name) {
concat.js(0x7620): Sahi.prototype._set = function (name, value) {
concat.js(0x7673): Sahi.prototype._get = function (name) {
concat.js(0x76d6): Sahi.prototype._assertNotNull = function (n, s) {
concat.js(0x775a): Sahi.prototype._assertExists = Sahi.prototype._assertNotNull
concat.js(0x7798): Sahi.prototype._assertNull = function (n, s) {
concat.js(0x7819): Sahi.prototype._assertNotExists = Sahi.prototype._assertNull
concat.js(0x7857): Sahi.prototype._assertTrue = function (n, s) {
concat.js(0x78d8): Sahi.prototype._assert = Sahi.prototype._assertTrue;
concat.js(0x790e): Sahi.prototype._assertNotTrue = function (n, s) {
concat.js(0x798a): Sahi.prototype._assertFalse = Sahi.prototype._assertNotTrue;
concat.js(0x79c8): Sahi.prototype._assertEqual = function (expected, actual, s) {
concat.js(0x7abe): Sahi.prototype._assertNotEqual = function (expected, actual, s) {
concat.js(0x7b71): Sahi.prototype._assertContainsText = function (expected, el, s)
concat.js(0x7d25): Sahi.prototype._getSelectedText = function (el) {
concat.js(0x7dfa): Sahi.prototype._option = function (el, text) {
concat.js(0x7ec2): Sahi.prototype._getText = function (el) {
concat.js(0x7f64): Sahi.prototype._getCellText = Sahi.prototype._getText;
concat.js(0x82dd): Sahi.prototype._alert = function (s) {
concat.js(0x8404): Sahi.prototype._lastAlert = function () {
concat.js(0x8472): Sahi.prototype._eval = function (s) {
concat.js(0x84b1): Sahi.prototype._call = function (s) {
concat.js(0x84ea): Sahi.prototype._random = function (n) {
concat.js(0x8547): Sahi.prototype._savedRandom = function (id, min, max) {
concat.js(0x8687): Sahi.prototype._resetSavedRandom = function (id) {
concat.js(0x86ee): Sahi.prototype._expectConfirm = function (text, value) {
concat.js(0x875c): Sahi.prototype._saveDownloadedAs = function(filePath){
concat.js(0x87fa): Sahi.prototype._lastDownloadedFileName = function(){
concat.js(0x88bb): Sahi.prototype._clearLastDownloadedFileName = function(){
concat.js(0x8936): Sahi.prototype._saveFileAs = function(filePath){
concat.js(0x8c6c): Sahi.prototype._lastConfirm = function () {
concat.js(0x8f1b): Sahi.prototype._lastPrompt = function () {
concat.js(0x8f8d): Sahi.prototype._expectPrompt = function (text, value) {
concat.js(0x8ff9): Sahi.prototype._prompt = function (s) {
concat.js(0x9063): Sahi.prototype._print = function (s){
concat.js(0x9194): Sahi.prototype._printCalled = function (){
concat.js(0x91f1): Sahi.prototype._clearPrintCalled = function (){
concat.js(0x925b): Sahi.prototype._cell = function (id, row, col) {
concat.js(0x9488): Sahi.prototype._table = function (n) {
concat.js(0x94d2): Sahi.prototype._row = function (tableEl, rowIx) {
concat.js(0x95c8): Sahi.prototype._containsHTML = function (el, htm) {
concat.js(0x9643): Sahi.prototype._containsText = function (el, txt) {
concat.js(0x96b3): Sahi.prototype._popup = function (n) {
concat.js(0x9770): Sahi.prototype._log = function (s, type) {
concat.js(0x97de): Sahi.prototype._navigateTo = function (url, force) {
concat.js(0x98b9): Sahi.prototype._callServer = function (cmd, qs) {
concat.js(0x9942): Sahi.prototype._removeMock = function (pattern) {
concat.js(0x99c4): Sahi.prototype._addMock = function (pattern, clazz) {
concat.js(0x9a93): Sahi.prototype._mockImage = function (pattern, clazz) {
concat.js(0x9b67): Sahi.prototype._debug = function (s) {
concat.js(0x9be6): Sahi.prototype._debugToErr = function (s) {
concat.js(0x9c63): Sahi.prototype._debugToFile = function (s, file) {
concat.js(0x9d2d): Sahi.prototype._enableKeepAlive = function () {
concat.js(0x9da3): Sahi.prototype._disableKeepAlive = function () {
concat.js(0xde56): Sahi.prototype._createCookie = Sahi.prototype.createCookie;
concat.js(0xe00a): Sahi.prototype._cookie = Sahi.prototype.readCookie;
concat.js(0xe099): Sahi.prototype._deleteCookie = Sahi.prototype.eraseCookie;
concat.js(0xe0d5): Sahi.prototype._event = function (type, keyCode) {
concat.js(0x184e9): Sahi.prototype._execute = function (command, sync) {
concat.js(0x1864d): Sahi.prototype._style = function (el, style) {
concat.js(0x1a098): Sahi.prototype._stopOnError = function(){
concat.js(0x1a0e4): Sahi.prototype._continueOnError = function(){
concat.js(0x1a239): Sahi.prototype._rteWrite = function(iframe, s){
concat.js(0x1a2b8): Sahi.prototype._rteHTML = function(iframe){
concat.js(0x1a336): Sahi.prototype._rteText = function(iframe){
concat.js(0x1a3b9): Sahi.prototype._re = function(s){
concat.js(0x1a414): Sahi.prototype._scriptName = function(){
lib.js(0x076e): Sahi.prototype._readFile = function (fileName) {
lib.js(0x07fb): Sahi.prototype._getDB = function (driver, jdbcurl, username, assword) {
lib.js(0x0bcd): Sahi.prototype._random = function (n) {
lib.js(0x0c2a): Sahi.prototype._scriptName = function(key){
lib.js(0x0c87): Sahi.prototype._logException = function(e){
lib.js(0x0cf6): Sahi.prototype._logExceptionAsFailure = function(e){

Comments

  • narayannarayan Administrators
    Robin,

    You should look at config/normal_functions.txt and config/scheduler_functions.txt to know the APIs that are intended to be exposed. Of the ones that are missing in the API docs, I need to add them to the documentation. You can use them as if they are official APIs.

    Regards,
    Narayan
  • Narayan,
    In my web application when I track a text to be deleted
    <del> tags are inserted in the html which contains the deleted word.
    When I looked at normal_function.txt and concat.js files it contains no deletion tag.
    Therefore I wrote _delete in my normal_functions and in concat.js I wrote
    this.addAD({tag:"DEL",type:"null",event:"click",name:"_delete"});

    And after this when I run sahi it hangs.
    Tell me can we add new html elements by this method or I am doing some mistake .
    Regards,
    Jiny
Sign In or Register to comment.