Hi.
I am trying to set up Sahi as an automated test framework for a large portal, and I need the speed of a headless browser. I have the following simple script that runs successfuly on Firefox (anonymized):
_navigateTo("https://my.web.site.no");
_click(_link("Login"));
_wait(10000,_exists(_div("username"))); // <-- this was an attempt to make it work in phantomjs, which also failed to improve the situation
_setValue(_textbox(0,_in(_div("username"))), "12345678901"); // <-- This is where it fails.
_click(_submit("Proceed"));
_assertExists(_listItem("User name is not valid.")); It fails in line 4 on phantomjs with the following message in the sahi log:
_setValue(_textbox(0,_in(_div("username"))), "12345678901"); - Error: The parameter passed to _in was not found on the browser at Sep 20, 2013 8:52:16 AM
Here is a html snippet from the page source in Firefox:
<div class="username" id="username">
<div class="col1"><span id="labelUsername">User name</span>:</div>
<div class="col2">
<span class="textUI">
<input type="text" name="security_authentication{pageFlow.authenticationFormBean.username}" value="" size="30">
</span>
<span class="buttonUI">
<input type="submit" name="security_authentication_action:selectedSomeType" value="Proceed">
</span>
</div>
</div>
I have tried several ways to make set that value for the text box, but it seems like I am unable to access the elements on this page in Phantomjs, while sahi does this without that problem in Firefox.
Can someone with experience with Sahi and phantomjs show me the light? :-)