Kev 69 Posted December 31, 2011 Report Share Posted December 31, 2011 Hi all, Ive searched the forum but cant get a correct solution for my problem. Here's the code: define Already Added Checker { if($search page("Webinars")) { then { Log Out() wait(3) click($element offset(<login link>, 0), "Left Click", "No") wait(3) } else { Add Product() } } } What I want to do is search a page for the word "Webinars" without quotes and the W is uppercase. If it finds the word Webinars on that page I want it to Log out, which works fine. However I am finding that it is running the Log Out routine regardless of whether there's a "Webinars" on the page or not. What am I doing wrong here? Thanks in advance, Kevin Quote Link to post Share on other sites
Guest michelsmith Posted December 31, 2011 Report Share Posted December 31, 2011 If you work with Sessions, then the search criteria could be stored in the session. You just need to make sure that the user also can easily reset the stored search criteria. $this->paginate = array( 'conditions' => array('Model.name LIKE' => '%'.$storedInTheSession.'%'), 'order' => array('Model.name ASC'), ); Quote Link to post Share on other sites
Kev 69 Posted December 31, 2011 Author Report Share Posted December 31, 2011 Hi michelsmith, Ok not too sure what you mean by sessions - is it "log in" sessions? I am looking for a word that appears on a page, sometimes it does, sometimes it doesnt. If it does, I want to "Log Out" - if it doesnt ) want it to do another function. I though doing the page search was the right thing, and maybe it is, but its not working right for me. Quote Link to post Share on other sites
JohnB 255 Posted December 31, 2011 Report Share Posted December 31, 2011 Try if $exists instead. John Quote Link to post Share on other sites
Kev 69 Posted December 31, 2011 Author Report Share Posted December 31, 2011 That works, thanks a million John. Quote Link to post Share on other sites
JohnB 255 Posted December 31, 2011 Report Share Posted December 31, 2011 You're welcome http://ubotstudio.com/forum/public/style_emoticons/default/smile.gif John Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.