regex - How to use regular expression in sahi script? -
i using sahi automate website, when record actions sahi recorder record click action of button(actually "span") _click(_span("done[4]"));
when play recorded script got failed on line not found "done[4]".
to solve tried regular expression click on _span("done[4]")
no luck.
html source structure :(this displayed in popup [ui-dialog,ui-widget])
<div class="dashboarddlgbuttonpanel"> <div id="addwidgetdone_wrapper" class="input_button "> <div id="addwidgetdone" class="form_input_button"> <div class="buttonwrapper"> <a style="width: 49px; height: 41px; display: block;" id="addwidgetdone_link" class="primarybutton" href="#" s1ignore="true" data-role="button" title=""> <span>done</span> </a> </div> </div> </div> <div id="addwidgetcancel_wrapper" class="input_button tertiarybutton"> <div id="addwidgetcancel"> <div class="buttonwrapper"> <a id="addwidgetcancel_link" class="link" href="#" s1ignore="true" title="">cancel</a> </div> </div> </div> </div>
i tried followings 1 one:
_click(_span(/done.*/)); _click(_span(/done\\[[0-9]\\]/)); _click(_span(/done\[[0-9]\]/)); _click(_span(/done/i)); _click(_span("/done/")); _click(_span(new reg exp("done\\[[0-9]\\]"))); _click(_span(/done.*/,_near(_div("addwidgetdone_wrapper[1]")))); _click(_span(/done.*/,_near(_div(/addwidgetdone_wrapper\\[[0-9]\\]/)))); _click(_span(/done.*/,_near(_div(/addwidgetdone_wrapper.*/)))); _click(_span(/done.*/,_in(_div("addwidgetdone_wrapper[1]")))); _click(_span(/done.*/,_in(_div(/addwidgetdone_wrapper/)))); _click(_span(/done.*/,_in(_div(/addwidgetdone_wrapper.*/))));
and many more other combination none of them working.
ref link :sahi-link-1 , sahi-link-2
can 1 please tell me wrong doing?
note : in recorded action "done[4]" numeric part getting changed every time.
please try using
_click(_span(done[0], _in(_link("addwidgetdone_link"))));
or
_click(_span(0, _in(_link("addwidgetdone_link"))));
Comments
Post a Comment