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.
Testing web-apps with ICEFaces components
Hi
I'm trying to setup sahi for testing our Web-Applications. As AJAX-Framework we use
ICEFaces. I've problems with the components 'Autocomplete' and 'Calendar' that we
often use.
For explanations, I created the following two test-scripts:
Testing the component 'Autocomplete':.
_navigateTo("component-showcase.icefaces.org");
_click(_link("Autocomplete"));
_setValue(_textbox("iceform:icepnltabset:0:AutoCmpTxt"), "z");
_click(_div("Zap"));
_setValue(_textbox("iceform:icepnltabset:0:AutoCmpTxtFace"), "z");
_click(_cell("New Jersey"));
_assertExists(_span("Zarephath[2]"));
_assert(_isVisible(_span("Zarephath[2]")));
_assertEqual("Zarephath", _getText(_span("Zarephath[2]")));
_assertContainsText("Zarephath", _span("Zarephath[2]"));
_assertExists(_span("New Jersey (NJ)"));
_assert(_isVisible(_span("New Jersey (NJ)")));
_assertEqual("New Jersey (NJ)", _getText(_span("New Jersey (NJ)")));
_assertContainsText("New Jersey (NJ)", _span("New Jersey (NJ)"));
... and testing the component 'Calendar':
_navigateTo("component-showcase.icefaces.org");
_click(_imageSubmitButton("Open popup calendar"));
_setSelected(_select("iceform:icepnltabset:0:popupDatePttrn1_sm"), "October");
_setSelected(_select("iceform:icepnltabset:0:popupDatePttrn1_sy"), "2014");
_click(_span("23[1]"));
_assertExists(_textbox("iceform:icepnltabset:0:popupDatePttrn1"));
_assert(_isVisible(_textbox("iceform:icepnltabset:0:popupDatePttrn1")));
_assertEqual("10/23/2014", _textbox("iceform:icepnltabset:0:popupDatePttrn1").value);
You will see, it doesn't work really good at all.... is that an AJAX-Problem which SAHI has or
what else could it be??
Thank you very much for any hint.
P.S
_navigateTo --> set http as prefix first, if you wanna try out the scripts ;o)
I'm trying to setup sahi for testing our Web-Applications. As AJAX-Framework we use
ICEFaces. I've problems with the components 'Autocomplete' and 'Calendar' that we
often use.
For explanations, I created the following two test-scripts:
Testing the component 'Autocomplete':.
_navigateTo("component-showcase.icefaces.org");
_click(_link("Autocomplete"));
_setValue(_textbox("iceform:icepnltabset:0:AutoCmpTxt"), "z");
_click(_div("Zap"));
_setValue(_textbox("iceform:icepnltabset:0:AutoCmpTxtFace"), "z");
_click(_cell("New Jersey"));
_assertExists(_span("Zarephath[2]"));
_assert(_isVisible(_span("Zarephath[2]")));
_assertEqual("Zarephath", _getText(_span("Zarephath[2]")));
_assertContainsText("Zarephath", _span("Zarephath[2]"));
_assertExists(_span("New Jersey (NJ)"));
_assert(_isVisible(_span("New Jersey (NJ)")));
_assertEqual("New Jersey (NJ)", _getText(_span("New Jersey (NJ)")));
_assertContainsText("New Jersey (NJ)", _span("New Jersey (NJ)"));
... and testing the component 'Calendar':
_navigateTo("component-showcase.icefaces.org");
_click(_imageSubmitButton("Open popup calendar"));
_setSelected(_select("iceform:icepnltabset:0:popupDatePttrn1_sm"), "October");
_setSelected(_select("iceform:icepnltabset:0:popupDatePttrn1_sy"), "2014");
_click(_span("23[1]"));
_assertExists(_textbox("iceform:icepnltabset:0:popupDatePttrn1"));
_assert(_isVisible(_textbox("iceform:icepnltabset:0:popupDatePttrn1")));
_assertEqual("10/23/2014", _textbox("iceform:icepnltabset:0:popupDatePttrn1").value);
You will see, it doesn't work really good at all.... is that an AJAX-Problem which SAHI has or
what else could it be??
Thank you very much for any hint.
P.S
_navigateTo --> set http as prefix first, if you wanna try out the scripts ;o)
Comments
It seems that nobody has a hint for that yet...
So the problem still is, that sahi can't fill out an ICEfaces 'Autocomplete input field' component
(where it should select an item from a suggested table).
;o(
I looked at the Autocomplete problem. It looks like the application keeps a few XMLHttpRequest objects open always, causing Sahi to wait indefinitely.
Open sahi/config/userdata.properties
And add this line at the end
xhr.wait_ready_states=2,3
Restart Sahi, and run the script. It should now proceed.
Regards,
Narayan
I did the following:
1. there is no userdata.properties under sahi/config so I added the line 'xhr.wait_ready_states=2,3' in sahi/config/userdata_template/config/userdata.properties
2. restarted Sahi and run the script --> doesn't work out
Did I do something wrong?
Thanks
Simon
Change in sahi/userdata/config/userdata.properties
JUST WONDERFUL!!! IT WORKS PRETTY FINE!! Thank you very much!
cheers
Simon