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.

Getting sahi error message

SrinivasSrinivas Members
edited November -1 in Sahi - Open Source
Getting "sahi error" message when i replay the recorded sahi scripts multiple times with different user data

The same script was working fine when i recorded the scripts,after replaying same scripts multiple times with different login data is not working and it is throwing sahi error message.Can any one pl help me to resolve this issue

Comments

  • Hi Srinivas,

    What version of Sahi are you using? Can you post the script?

    Can you post the contents of Sahi console.

    Also, does this happen on all the browser?

    Regards
    Sumitra
  • Hi Sumitra,

    Windows XP
    IE8
    Sahi Build: 2011-07-19

    I also get the SAHI_ERROR during playback. I refresh the page, then the script continues to run. I did not check with other browsers.

    Below is the Sahi console message:

    _setValue(_textbox("txtUserName"), "admin");
    _setValue(_password("txtPassword"), "password");
    _click(_submit("Login"));
    _click(_link("Setup"));
    _click(_link("Create Event Title/Series"));
    _click(_submit("Add Event"));
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642162155', _lastAlert());
    _assertEqual("- Select event type\r\n- Select event category\r\n- Enter Event Title\r\n- Enter event charge\r\n- Enter event color", "- Select event type\r\n- Select event category\r\n- Enter Event Title\r\n- Enter event charge\r\n- Enter event color", "Dedicated-Diploma: Leave all the fields empty. Click Save button. Proper alert message should be displayed");
    _setSelected(_select("ddlEventType"), "Dedicated");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642166359', _lastAlert());
    _assertEqual("- Select event category\r\n- Enter Event Title\r\n- Enter event charge\r\n- Enter event color", "- Select event category\r\n- Enter Event Title\r\n- Enter event charge\r\n- Enter event color", "Dedicated-Diploma: Leave Event Category, Event Title, Event Charge, Event Color empty. Proper alert message should be displayed");
    _setSelected(_select("ddlEventCategory"), "Diploma");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642169765', _lastAlert());
    _assertEqual("- Enter Event Title\r\n- Enter event charge\r\n- Enter event color", "- Enter Event Title\r\n- Enter event charge\r\n- Enter event color", "Dedicated-Diploma: Leave Event Title, Event Charge, Event Color empty. Proper alert message should be displayed");
    _setValue(_textbox("txtEventTitle"), "dedicated_diploma");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642170874', _lastAlert());
    _assertEqual("- Enter event charge\r\n- Enter event color", "- Enter event charge\r\n- Enter event color", "Dedicated-Diploma: Leave Event Charge, Event Color empty. Proper alert message should be displayed");
    _setValue(_textbox("txtEventCharge"), "1000");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642171765', _lastAlert());
    _assertEqual("- Enter event color", "- Enter event color", "Dedicated-Diploma: Leave Event Color empty. Proper alert message should be displayed");
    _click(_image("ColorPicker.jpg"));
    _click(_div("colorSquare[4]"));
    _click(_div("colorSquare[4]"));
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642174530', _lastAlert());
    _setValue(_textbox("txtEventTitle"), "dedicated_diploma_1");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642191515', _lastAlert());
    _setValue(_textbox("txtEventTitle"), "dedicated_diploma_2");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642201858', _lastAlert());
    _setValue(_textbox("txtEventTitle"), "dedicated_diploma_3");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642207718', _lastAlert());
    _setValue(_textbox("txtEventTitle"), "dedicated_diploma_4");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642215968', _lastAlert());
    _setValue(_textbox("txtEventTitle"), "dedicated_diploma_5");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642219046', _lastAlert());
    _setValue(_textbox("txtEventTitle"), "dedicated_diploma_6");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642223202', _lastAlert());
    _setValue(_textbox("txtEventTitle"), "dedicated_diploma_7");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642228889', _lastAlert());
    _setValue(_textbox("txtEventTitle"), "dedicated_diploma_8");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642235952', _lastAlert());
    _setValue(_textbox("txtEventTitle"), "dedicated_diploma_9");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642242327', _lastAlert());
    setServerVar('___lastValue___1317642250061', _getText(_byId("gridEventTitle_ctl02_lblEvent_Title")));
    _assertEqual("dedicated_diploma_9", "dedicated_diploma_9", "Dedicated-Diploma: Add an Event Title with mandatory fields only. Event Title should be listed in the list page");
    setServerVar('___lastValue___1317642250624', _getText(_byId("gridEventTitle_ctl02_lblTypename")));
    _assertEqual("Diploma", "Diploma", "Dedicated-Diploma: Add an Event Title with mandatory fields only. Course Type should be displayed properly in the list page");
    setServerVar('___lastValue___1317642251077', _getText(_link(0, _near(_span("dedicated_diploma_9")))));
    _assertEqual("Series/Course", "Series/Course", "Dedicated-Diploma: Add an Event Title with mandatory fields only. Series/Course link should be displayed properly in the list page");
    _assertEqual(true, true, "Dedicated-Diploma: Add an Event Title with mandatory fields only. Edit button should be displayed properly in the list page");
    _assertEqual(true, true, "Dedicated-Diploma: Add an Event Title with mandatory fields only. Delete button should be displayed properly in the list page");
    _click(_link("Setup"));
    _click(_link("Create Event Title/Series"));
    _click(_submit("Add Event"));
    _setSelected(_select("ddlEventType"), "Dedicated");
    _setSelected(_select("ddlEventCategory"), "Diploma");
    _setValue(_textbox("txtEventCharge"), "1000");
    _setValue(_textbox("txtPurchaseNo"), "PO");
    _click(_image("ColorPicker.jpg"));
    _click(_div("colorSquare[4]"));
    _click(_div("colorSquare[4]"));
    _setFile(_file("ImgFileUpload"), "");
    _setFile(_file("ImgFileUpload"), "D:\\Projects\\In progress\\Sahi\\Installation\\userdata\\scripts\\itemCode.jpg");
    _setValue(_textbox("txtEventTitle"), "dedicated_diploma_allFields");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642289061', _lastAlert());
    _setValue(_textbox("txtEventTitle"), "dedicated_diploma_allFields_1");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642319076', _lastAlert());
    _setValue(_textbox("txtEventTitle"), "dedicated_diploma_allFields_2");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642328108', _lastAlert());
    _setValue(_textbox("txtEventTitle"), "dedicated_diploma_allFields_3");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642332154', _lastAlert());
    _setValue(_textbox("txtEventTitle"), "dedicated_diploma_allFields_4");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642337139', _lastAlert());
    _setValue(_textbox("txtEventTitle"), "dedicated_diploma_allFields_5");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642340420', _lastAlert());
    setServerVar('___lastValue___1317642350264', _getText(_byId("gridEventTitle_ctl02_lblEvent_Title")));
    _assertEqual("dedicated_diploma_allFields_5", "dedicated_diploma_allFields_5", "Dedicated-Diploma: Add an Event Title with both mandatory and optional fields. Event Title should be listed in the list page");
    setServerVar('___lastValue___1317642350717', _getText(_byId("gridEventTitle_ctl02_lblTypename")));
    _assertEqual("Diploma", "Diploma", "Dedicated-Diploma: Add an Event Title with both mandatory and optional fields. Course Type should be displayed properly in the list page");
    setServerVar('___lastValue___1317642351154', _getText(_link(0, _near(_span("dedicated_diploma_allFields_5")))));
    _assertEqual("Series/Course", "Series/Course", "Dedicated-Diploma: Add an Event Title with both mandatory and optional fields. Series/Course link should be displayed properly in the list page");
    _assertEqual(true, true, "Dedicated-Diploma: Add an Event Title with both mandatory and optional fields. Edit button should be displayed properly in the list page");
    _assertEqual(true, true, "Dedicated-Diploma: Add an Event Title with both mandatory and optional fields. Delete button should be displayed properly in the list page");
    _click(_link("Setup"));
    _click(_link("Create Event Title/Series"));
    _click(_submit("Add Event"));
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642368029', _lastAlert());
    _assertEqual("- Select event type\r\n- Select event category\r\n- Enter Event Title\r\n- Enter event charge\r\n- Enter event color", "- Select event type\r\n- Select event category\r\n- Enter Event Title\r\n- Enter event charge\r\n- Enter event color", "Dedicated-Certification: Leave all the fields empty. Click Save button. Proper alert message should be displayed");
    _setSelected(_select("ddlEventType"), "Dedicated");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642371435', _lastAlert());
    _assertEqual("- Select event category\r\n- Enter Event Title\r\n- Enter event charge\r\n- Enter event color", "- Select event category\r\n- Enter Event Title\r\n- Enter event charge\r\n- Enter event color", "Dedicated-Certification: Leave Event Category, Event Title, Event Charge, Event Color empty. Proper alert message should be displayed");
    _setSelected(_select("ddlEventCategory"), "Certification");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642374498', _lastAlert());
    _assertEqual("- Enter Event Title\r\n- Enter event charge\r\n- Enter event color", "- Enter Event Title\r\n- Enter event charge\r\n- Enter event color", "Dedicated-Certification: Leave Event Title, Event Charge, Event Color empty. Proper alert message should be displayed");
    _setValue(_textbox("txtEventTitle"), "dedicated_certification");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642375951', _lastAlert());
    _assertEqual("- Enter event charge\r\n- Enter event color", "- Enter event charge\r\n- Enter event color", "Dedicated-Certification: Leave Event Charge, Event Color empty. Proper alert message should be displayed");
    _setValue(_textbox("txtEventCharge"), "1000");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642376951', _lastAlert());
    _assertEqual("- Enter event color", "- Enter event color", "Dedicated-Certification: Leave Event Color empty. Proper alert message should be displayed");
    _click(_image("ColorPicker.jpg"));
    _click(_div("colorSquare[4]"));
    _click(_div("colorSquare[4]"));
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642379685', _lastAlert());
    _setValue(_textbox("txtEventTitle"), "dedicated_certification_1");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642384857', _lastAlert());
    setServerVar('___lastValue___1317642394435', _getText(_byId("gridEventTitle_ctl02_lblEvent_Title")));
    _assertEqual("dedicated_certification_1", "dedicated_certification_1", "Dedicated-Certification: Add an Event Title with mandatory fields only. Event Title should be listed in the list page");
    setServerVar('___lastValue___1317642394982', _getText(_byId("gridEventTitle_ctl02_lblTypename")));
    _assertEqual("Certification", "Certification", "Dedicated-Certification: Add an Event Title with mandatory fields only. Course Type should be displayed properly in the list page");
    setServerVar('___lastValue___1317642395545', _getText(_link(0, _near(_span("dedicated_certification_1")))));
    _assertEqual("Series/Course", "Series/Course", "Dedicated-Certification: Add an Event Title with mandatory fields only. Series/Course link should be displayed properly in the list page");
    _assertEqual(true, true, "Dedicated-Certification: Add an Event Title with mandatory fields only. Edit button should be displayed properly in the list page");
    _assertEqual(true, true, "Dedicated-Certification: Add an Event Title with mandatory fields only. Delete button should be displayed properly in the list page");
    _click(_link("Setup"));
    _click(_link("Create Event Title/Series"));
    _click(_submit("Add Event"));
    _setSelected(_select("ddlEventType"), "Dedicated");
    _setSelected(_select("ddlEventCategory"), "Certification");
    _setValue(_textbox("txtEventCharge"), "1000");
    _setValue(_textbox("txtPurchaseNo"), "PO");
    _click(_image("ColorPicker.jpg"));
    _click(_div("colorSquare[4]"));
    _click(_div("colorSquare[4]"));
    _setFile(_file("ImgFileUpload"), "");
    _setFile(_file("ImgFileUpload"), "D:\\Projects\\In progress\\Sahi\\Installation\\userdata\\scripts\\itemCode.jpg");
    _setValue(_textbox("txtEventTitle"), "dedicated_certification_allFields");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642429919', _lastAlert());
    _setValue(_textbox("txtEventTitle"), "dedicated_certification_allFields_1");
    _clearLastAlert();
    _click(_submit("Save"));
    setServerVar('___lastValue___1317642451357', _lastAlert());
    setServerVar('___lastValue___1317642456404', _getText(_byId("gridEventTitle_ctl02_lblEvent_Title")));
    _assertEqual("dedicated_certification_allFields_1", "dedicated_certification_allFields_1", "Dedicated-Certification: Add an Event Title with both mandatory and optional fields. Event Title should be listed in the list page");
    setServerVar('___lastValue___1317642456841', _getText(_byId("gridEventTitle_ctl02_lblTypename")));
    _assertEqual("Certification", "Certification", "Dedicated-Certification: Add an Event Title with both mandatory and optional fields. Course Type should be displayed properly in the list page");
    setServerVar('___lastValue___1317642457404', _getText(_link(0, _near(_span("dedicated_certification_allFields_1")))));
    _assertEqual("Series/Course", "Series/Course", "Dedicated-Certification: Add an Event Title with both mandatory and optional fields. Series/Course link should be displayed properly in the list page");
    _assertEqual(true, true, "Dedicated-Certification: Add an Event Title with both mandatory and optional fields. Edit button should be displayed properly in the list page");
    _assertEqual(true, true, "Dedicated-Certification: Add an Event Title with both mandatory and optional fields. Delete button should be displayed properly in the list page");
    _wait(1000);
    --Stopped Playback: SUCCESS--
  • I am new to Sahi but able to record and replay couple of login scripts successfully on IE and FF browsers. My script is failing on chrome and safari(windows) version) browsers. But the same script works fine on IE9 and FF 7.0 browsers. I am using Sahi 20110719 version. I have noticed that the script is failing at the below section. So, i thought chrome and safari(windows) was unable to recognize _span property. Can someone help me to overcome with this error?
    Script is just stopping at this point with FAILURE.

    _assertExists(_span("Mail (1)"));
    Assertion Failed. at Oct 4, 2011 2:48:27 PM
    _assert(_isVisible(_span("Mail (1)")));
    Assertion Failed. at Oct 4, 2011 2:48:39 PM
    _assertEqual("Mail (1)", _getText(_span("Mail (1)")));
    Error: The parameter passed to _getText was not found on the browser at Oct 4, 2011 2:48:52 PM
  • Hi tsiva,

    Can you post the URL and the script?

    Can you Ctrl+Hover on the span and check if Sahi is able to identify the span on safari and chrome browser?

    Also, post the contents of Sahi console.

    Regards
    Sumitra
  • I also get the same problem as with tsiva.
    My upload script in IE and FF works fine but not in Chrome and Safari.

    _call(_domain("stagingfile.printrunner.com")._setFile(_file("Filedata"), "C:/Users/crabaino.WEBPRODEV/Pictures/bgrounds/The-Gentle-Home-X2.jpg")); Window/Domain not found: popupNameFromStep=; derivedName=; windowName=; windowTitle=PrintRunner | Online Printing; wasOpened=0; domain=
Sign In or Register to comment.