Jump to content
UBot Underground

Click Webpage Message When They Appear


Recommended Posts

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

Link to post
Share on other sites

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")
    }
}
Link to post
Share on other sites

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.

  • Like 1
Link to post
Share on other sites

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...