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.

pop up issue

edited November -1 in Sahi - Open Source
i am testing an application and i have encountered a problem suppose in a page where there are some text boxes and send this order button when i wont enter any text in the required fields and enter the send this order button validations pop up opens but i am not able to get the details using sahi.


code part:---

_click(_link("MENU"));
_click(_link("+"));
_click(_link("+[1]"));
_click(_link("+[2]"));
_click(_link("+[3]"));
_click(_link("+[4]"));
_click(_link("+[5]"));
_click(_link("ORDER THIS"));
_setValue(_textbox("name[1]"), "");
_setValue(_textbox("email"), "");
_setValue(_textbox("cellno"), "");
_setValue(_textbox("landline"), "");
_setValue(_textbox("address-first"), "");
_setValue(_textbox("address-second"), "");
_setValue(_textbox("address-landmark"), "");
_setValue(_textbox("address-area"), "");
_click(_checkbox("asap"));
_click(_image("..."));
_click(_link("24"));
_click(_listItem("Bring me food as soon as possible"));
_click(_listItem("Bring me food as soon as possible"));
_click(_checkbox("asap"));
_setSelected(_select("hours"), "9");
_setSelected(_select("ampm"), "PM");
_setValue(_textarea("instructions"), "bring the food soon");
_click(_button("Send This Order"));
_click(_checkbox("1"));
_click(_button("Send"));
_click(_link("Close[1]"));

//_assertNotEqual("- Name is blank",_lastAlert());

//_log(_lastAlert());

if(_log(_lastAlert()) != null)
{
_assertNotTrue(_lastAlert().indexOf("- Name is blank") != -1);
_assertNotTrue(_lastAlert().indexOf("- Incorrect email format") != -1);
_assertNotTrue(_lastAlert().indexOf("- We need at least one contact. Either cell or landline") != -1);
_assertNotTrue(_lastAlert().indexOf("- Plot/Apt/Door is blank") != -1);
_assertNotTrue(_lastAlert().indexOf("- Street/locality is blank") != -1);
_assertNotTrue(_lastAlert().indexOf("- Landmark is blank") != -1);
_assertNotTrue(_lastAlert().indexOf("- Area is blank") != -1);
}

/*

if(_log(_lastAlert()) != null)
{
_assertTrue(_lastAlert().indexOf("- Name is blank") != -1);
_assertTrue(_lastAlert().indexOf("- Incorrect email format") != -1);
_assertTrue(_lastAlert().indexOf("- We need at least one contact. Either cell or landline") != -1);
_assertTrue(_lastAlert().indexOf("- Plot/Apt/Door is blank") != -1);
_assertTrue(_lastAlert().indexOf("- Street/locality is blank") != -1);
_assertTrue(_lastAlert().indexOf("- Landmark is blank") != -1);
_assertTrue(_lastAlert().indexOf("- Area is blank") != -1);

}
Sign In or Register to comment.