Section

From UBot Studio
Revision as of 19:33, 17 March 2015 by LillyT (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This command is a Flow Command. This container command will run commands within it once. This command works with the log commands Purpose, Log, Establish and Activity.

Section: The labeled assigned to the section.


Example

In this example, we are unit testing our bot to make sure it runs as it is designed to do.

In one tab, we have one command and two functions defined:

define $Pad Text(#text) {
    return("xxx{#text}xxx")
}
define $bing website {
    return("http://bing.com")
}
define navigate to domain(#domain) {
    navigate("http://{#domain}.com","Wait")
}
define navigate to bing {
    navigate($bing website(),"Wait")
}


These functions and command are easy to section since each command or function only has one purpose.

In another tab, we section off the command and functions and test to make sure if they work appropriately.

There is a section for the functions called functions. There is also a section created for the commands within the script.


ui log view("Log")
clear all data
purpose("To make sure my bot works")
section("functions") {
    establish("pad text works",$comparison(#padded text,"=","xxxtestxxx"),"No") {
        set(#padded text,$Pad Text("test"),"Global")
    }
    establish("bing website function works",$comparison(#url,"=","http://bing.com"),"No") {
        set(#url,$bing website(),"Global")
    }
}
section("commands") {
    establish("navigate to domain works",$comparison($url,"=","http://www.reddit.com/"),"No") {
        navigate to domain("reddit")
    }
    establish("navigate to bing works",$comparison($url,"=","http://www.bing.com/"),"No") {
        navigate to bing()
    }
}

Running the script creates a neat, easy to read log of what each section is doing and whether or not it's purpose was completed successfully.

Purpose: To make sure my bot works
functions
Establish: "pad text works"
    Successfully established
Establish: "bing website function works"
    Successfully established
commands
Establish: "navigate to domain works"
    Successfully established
Establish: "navigate to bing works"
    Successfully established


According to our logview, the section Functions completed its tasks successfully.

The section Commands also completed its tasks successfully.

Placing the #log variable into the load html command will display the log clearly within the browser.


Sections.jpg

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox