Commands:Change chosen attribute

Your goal in many scripts will be to modify websites – whether by filling text boxes, clicking buttons, or choosing from drop-down lists. The change chosen attribute command allows you to modify any modifiable attribute of an element, regardless of which attribute you select. After choosing an element by attribute, you will often be using the “change chosen attribute” command to modify the page itself.



For example, you could select an attribute by its position and then modify the “value” attribute, as in the following example, which fills two separate text boxes with the words “test” and “me".

(Special note about drop-down boxes: Frequently drop-down boxes “values” are not the same as the value that a user selects. For instance, a drop-down box with a list of months may have values of 1 through 12, even though the values say “Jan” or “Feb”. If you wish to choose a value in a drop-down list, you should change the value to the one you would like to use first, then use the “change chosen attribute” command. This will automatically fill UBot’s search string box with the appropriate attribute and aid you from having to guess what the value fields are. )

(Special note about checkboxes: The value you will want to change when selecting a checkbox will often be “Checked,” which has parameters of “true” for yes and “false” for no.)

(Special note about file uploading: Certain text boxes that allow you to browse files on your own hard drive are “protected” against their values being changed. Please see the “Send keys chosen” command for information on how to get around this.

Remember: the most recently chosen element on a page will be the one that “change chosen attribute” modifies. This slightly modified script would only fill text field “Input 5,” and it would fill it first with the value “test,” then replace that value with the value “me”, leaving you with one empty text box, and another that contains the value “me”.