18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
Negative testing
HI Team,
i want to write script for negative testing of my application.Please help me out with this.i need to capture all the validation messages that are popping up in my application.Below is my script
_setValue(_textbox("username"), "501210786");
_setValue(_password("password"), "Pa77word");
_click(_submit("Sign In"));
_click(_link("AFFILIATE CARRIAGE"));
_setValue(_textbox("dealMemoTitle"), "test12345");
_setValue(_textarea("description"), "test12345");
_click(_cell("11"));
_setValue(_textbox("dealMemoDate"), "03/11/2015");
_click(_cell("11"));
_click(_list(2));
_setValue(_textbox("totalValue"), "-102250");
_click(_listItem("Total Value (Exact Amount):* Please enter valid Amount/Value."));
_setValue(_textbox("ocfBudget"), "3000");
_click(_listItem("Variance Vs. Current Deal:"));
_setValue(_textbox("varianceDeal"), "abcd");
_click(_label("Variance Vs. Current Deal:"));
_setSelected(_select("companies"), ["Sparrowhawk International Channels Limited"]);
_setSelected(_select("directors"), ["Joanna Sherlock"]);
_click(_checkbox("channel[6]"));
_click(_button("SUBMIT"));
_click(_listItem("OCF Variance Vs. Current Budget:"));
--Stopped Playback: SUCCESS--
i want to write script for negative testing of my application.Please help me out with this.i need to capture all the validation messages that are popping up in my application.Below is my script
_setValue(_textbox("username"), "501210786");
_setValue(_password("password"), "Pa77word");
_click(_submit("Sign In"));
_click(_link("AFFILIATE CARRIAGE"));
_setValue(_textbox("dealMemoTitle"), "test12345");
_setValue(_textarea("description"), "test12345");
_click(_cell("11"));
_setValue(_textbox("dealMemoDate"), "03/11/2015");
_click(_cell("11"));
_click(_list(2));
_setValue(_textbox("totalValue"), "-102250");
_click(_listItem("Total Value (Exact Amount):* Please enter valid Amount/Value."));
_setValue(_textbox("ocfBudget"), "3000");
_click(_listItem("Variance Vs. Current Deal:"));
_setValue(_textbox("varianceDeal"), "abcd");
_click(_label("Variance Vs. Current Deal:"));
_setSelected(_select("companies"), ["Sparrowhawk International Channels Limited"]);
_setSelected(_select("directors"), ["Joanna Sherlock"]);
_click(_checkbox("channel[6]"));
_click(_button("SUBMIT"));
_click(_listItem("OCF Variance Vs. Current Budget:"));
--Stopped Playback: SUCCESS--
Answers
http://sahipro.com/docs is really handy. It provides you a lot of information. Check link http://sahipro.com/docs/sahi-apis/javascript-dialogs.html#_lastAlert - _lastAlert gives you the messages. Also, doc specifies what version of Sahi supports a particular API.