UI drop down

From UBot Studio
Jump to: navigation, search

This command is a UI Command. The command creates a drop down menu on the UI panel tied to a specific variable.

Label: refers to the label for the drop down box as it appears on the interface.

Values Separated by Commas: The values that will appear individually within the drop down box.

Corresponding Variable: refers to the name for the variable that will correspond to the drop down box.


Example 1

load html("
<html>
<body>

<form action=\"\">
<select name=\"Months\">
<option value=\"january\">January</option>
<option value=\"february\">February</option>
<option value=\"march\">March</option>
<option value=\"april\">April</option>
</select>
</form>

</body>
</html>

")
ui drop down("Select a Month:", "january,february,march,april", #months)
change attribute(<name="Months">, "value", #months)


Placing the variable for the UI drop down command into the change attribute command changes the value of the drop down in the main browser to whatever value the UI on the interface is set to.


Drop.jpg


Example 2: If Then Else

The following script uses the UI drop down to determine how to script runs.

ui drop down("Emails", "myemail@email.com,youremail@email.com,theiremail@email.com", #uidropdown)
navigate("http://www.ubotstudio.com/playground/difficult-form", "Wait")
wait(3)
if($comparison(#uidropdown, "=", "myemail@email.com")) {
    then {
        type text(<username field>, "myemail@email.com", "Standard")
        type text(<first name field>, "myusername", "Standard")
        type text(<password field>, "emailpasswe6567", "Standard")
    }
    else if($comparison(#uidropdown, "=", "youremail@email.com")) {
        type text(<username field>, "youremail@email.com", "Standard")
        type text(<first name field>, "yourusername", "Standard")
        type text(<password field>, "youremailpasswe6567", "Standard")
    }
    else if($comparison(#uidropdown, "=", "theiremail@email.com")) {
        type text(<username field>, "theiremail@email.com", "Standard")
        type text(<first name field>, "theiremail", "Standard")
        type text(<password field>, "theiremailpasswe6567", "Standard")
    }
}

The script will fill information into the form fields depending on the value the UI drop down is set to, and what conditional is set.

Feel free to play with he script and edit the value to learn how the behavior of the script is affected.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox