spa3212 1 Posted January 21, 2016 Report Share Posted January 21, 2016 Hi,can anyone help me.. I want to click some message let say "close" But its not certain when it will appear.. is this possition to click close button, when its not certain where it will appear..sometime it appear soon after login, sometime after posting an article, I means it not really certain. such message appear as message box with close or ok buttons.. please help Quote Link to post Share on other sites
pash 504 Posted January 22, 2016 Report Share Posted January 22, 2016 try. navigate("https://www.google.com","Wait") wait for browser event("Everything Loaded","") wait for element(<innertext="Gmail">,"","Appear") if($exists(<innertext="Gmail">)) { then { alert("Hello Google") type text(<name="q">,"Hello Google","Standard") } else { alert("Don\'t see Google") } } Quote Link to post Share on other sites
ZackP 2 Posted January 22, 2016 Report Share Posted January 22, 2016 Hi spa3212, In this position, use the "If" flow command after every action that may cause the element to appear. if($exists(<innertext="Video Training in Ten Minutes or Less!">)) { then { click(<innertext=" Video Training in Ten Minutes or Less! ">, "Left Click", "No") } } In the above example, taken off of the Wiki - http://wiki.ubotstudio.com/wiki/If, if the element in line one (<innertext="Video Training in Ten Minutes or Less!">) exists, then the actions outlined below are completed. Here it is in node view. http://wiki.ubotstudio.com/images/8/8f/If.jpg For now, you can likely ignore the "Else" part of the statement. The "Else" statement allows for a separate set of commands to be done. You just want your bot to continue with what it had been doing, and if the element is not found, the action in the "If" statement will not be completed. 1 Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 22, 2016 Report Share Posted January 22, 2016 In this position, use the "If" flow command after every action that may cause the element to appear. Throw that into a define command, paste custom command everywhere in the program and you're set. Quote Link to post Share on other sites
spa3212 1 Posted January 27, 2016 Author Report Share Posted January 27, 2016 so there is not way, except pasting that command after every action...that,s makes code ugly Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 27, 2016 Report Share Posted January 27, 2016 so there is not way, except pasting that command after every action...that,s makes code ugly Well after performing each of those actions you are probably waiting for a page to load anyways so you can put that along with page wait commands into one single define and just call that after every page load and it may end up making your code a lot cleaner in the end. 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.