UBot Studio – Stealth
Basic Training – Tab 1
For the Native UBot Browser
Okay, let’s help you learn some of the core scripting nodes to get you on your way…
One of the first things we do when we’re developing a bot is to use the site as a human would. Then jot down the processes to get a sense of the bot logic and flow. Most importantly we make sure we can do the tasks in UBot in some way, whether it is with the native browser or via a free/paid Plugin. The next step is to test the page elements to see if the ones we need are programmable. All the data manipulation we do when we know that we can actually automate the site. So here in the first tab we will test the elements on the form and submit it, doing this all manually and in the other tabs fill in the supporting logic. What I mean by manually Is to run each node at a time while we build it to make sure it runs.
For the sake of simplicity we are not going to sign in any where like a Social Media site. We will skip a few steps for now. We will pretend we have already done so by not logging in. The site we will be using is easy to work with and is great for our basic bot to demonstrate the common commands and functions used in everyday bot building.
There are a few ways you can build your logic. On a basic site like httpbin.org one can use the “Recording Feature” or you can drag and drop required nodes one by one. You can do this two ways, from the “Toolbox” or from the elements themselves in the browser. If you like typing you can use the “Search Box” (Ctrl + e) or just use the “Code View”. I like to just drag from the browser and place it where I need it or right click on the element then choose from the menu. Then if the form field is a text box that requires data I will fill it in with some fake temporary data.
Let’s drag the “navigate” command on over to the code editor and run it to see our form we will be working with. In the URL field put http://httpbin.org/forms/post hit enter and right click on the top of the navigation node. You will get a context menu, click run node. Cool! Good job Newbie!
The “navigate” command, this baby takes us to where we need to go on the web or we can view images from a file path right in the browser. Some nodes have an “Advance” drop down with some additional options. In most cases you will not change the default setting for this in the Navigation node. I personally have never needed to worry about it. The next node however, it seams to go with navigating most of the time.
In the text editor click “drag commands here”. This will tell U Bot where to put the next command. Now, in the browser right click on the text area of the delivery instructions. You’ll see a menu and look for wait for element and click that.
The “wait for element”(wfe) is a time saver despite its name. You can wait for an element to appear or disappear with a timeout even. Most of the time you will using the default “Appear” and I totally recommend that you put something in the timeout field. I put 10 or 15(seconds) while I am building a bot. Then eventually the end user will have a configuration(config) file where they can use there own settings for there own internet speeds. If you leave it blank it will wait on its own internal(default) setting. It is roughly 2 minutes I believe. The purpose is to make sure the bot is not moving to fast for the page to load and we want to make sure all the elements we need are there before we move ahead with our logic. This ensures we are moving along as fast and accurate as possible.
The next set of commands will be “type text”, this simulates a super fast typing human and is used for text fields. In the “Advanced” drop down menu, you have more options to simulate human characteristics. That with a loop, list and a wait command you can slow it down to look more realistic if you need to… but, that is for another tutorial. For now, we will add these next three commands like we did the previous one. This time we will hover the mouse over the desired elements and press the LEFT mouse button then start dragging, you will see your mouse change into the command now put it next in line. Now, we will “hard code” the values to make sure things are working correctly. Wow, Newbie! you are really getting the hang of this.
For the Pizza Size – these input elements are called “Radio Buttons” and this set you can only choose one. Using the same technique as above we pick one of the options and will be using the click command. We will solve the problem of choosing a random size for every customer order later.
Ah, so we got the magic “click” command! In the “Advanced” drop downs you will see all the options that are provided. Click by location I haven’t had to use but I have seen some folks suggest using it and it did the trick. Definitely not something to worry about for this tutorial.
And for the Pizza Toppings – these elements are check boxes that we can choose more than one. For now, we will just choose one to prove we can do it and solve the problem of choosing multiple boxes or random sets of, toppings. Now, we will right click one and the first menu item should be the most likely choice which is change check box. Click that or just drag it like before.
“change checkbox” this command just makes sure the check box element that you want is either checked or unchecked. This command is not too complicated.
Time and Delivery Instructions – the time field is a little special and needed some love and will be covered in tab 3. For the delivery instructions, this is a multi line text area and can take many more characters than just a text box. Drag these two babies into the editor or try typing into the search box type text and hit enter and hope fully the it lands where you want it. It should if the dotted line is where you need it to. You should know how to fix this by now, if it does not. Are you up for something new Newbie?
Okay, we need to choose which element we want, underneath the yellow field there are 3 buttons. If you hover over them you will learn what they do. We want the first one that looks like this < > button. Click on this button and then go click in the time field. Now UBot knows how to find it. Put 0530pm in the text to type field. If done correctly you should now see <name=”delivery”> int in the yellow field. Awesome Newbie! Can you run the node to test it please?
It worked! Fabulous!
Next to last we have the delivery instructions. Click under the last node then, right click in the box for the delivery instructions. At the top there is our “type text” command. Click that and fill in the “Text to Type” field with something less than creative. Alright, now test it and we will get the last element.
Before the last element we will put a “stop script” command in to stop the bot from submitting the form before we make a mistake and accidentally submit our bogus data. Once we check all the fields to make sure the bot works as expected we can then run the final click command to click the submit button to send it to the server.
Okay, now just hover the submit button and drag it to the last position. Click okay to close it. Now we can finally run our code!
Once we have all the input elements in the code editor we can hit the “Run” button or the F5 key and if there are no errors we can move on to the next stage.
Looks like everything ran well let’s hit the command that clicks the submit button. Ooops! Something went wrong. Hmmm, looks like the email field is not correct, let’s fix that real quick and we should be good.
Now let’s move the stop command down or delete it and run the code!
Ool! We got the response from the server now, looks like we got it right finally good job Newbie!
In this case the response is in JSON but usually you will get a success page when you submit a form and you would check/test if an element exists to make sure your bot made it. You could either check for success text or some unique element. If not successful there could be an error on the original page and one would test for this as well.
Let’s continue shall we? We did a lot in this one and the rest of the UBot tutorials are not this long.