ADD Cookie
arguments:[Name | value | path=none | domain=none | secure=none | expiry=none]
Adds a cookie to your the current session. "Name" and "value" is required, "path", "Domain" and "secure" are optional
Description: Not used, to be added ...
Alert should be Present
arguments:[text=]
Verifies an alert is present and dismisses it.
If ' text ' is a non-empty string, then it's also verified that message of the alert equals to ' text '.
Would fail if no alert is present. Note that following keywords would fail unless the alert is dismissed by this keyword or another like ' Get alert Message '.
Note: The Pop-up box alert is displayed by the text content of the popup alert.
Example: Alert should be Present | Saved successfully
Assign Id to Element
arguments:[Locator | id]
Assigns a temporary identifier to element specified by ' locator '.
This is mainly useful if the locator is Complicated/slow XPath expression. Identifier expires when the page is reloaded.
Description: Assigns an ID to an element that is missing an ID.
Example: Assign Id to Element | //div[@class = ' textarea-clear-btn ' | ClassID01
Call Client Method for Element
arguments:[Locator | jsmethodname | *args]
Call client method, element identified by ' locator '.
Description: Not used, to be added ...
Capture Page screenshot
arguments:[Filename=none]
Takes A screenshot of the current page and embeds it into the log.
' filename ' argument specifies the name of the file to write the screenshot into. If no ' filename ' is given, the screenshot are saved into file ' Selenium-screenshot-<counter>.png ' under the directory The Where the Robot Framework log file is written into. The ' filename ' is also considered relative to the same directory, if it's not given in absolute format.
' CSS ' can be used to modify how the screenshot is taken. By default the Bakground color was changed to avoid possible problems with background leaking when the page layout is Someh ow broken.
Description: Captures the Web page. Can be named or used with the default name (selenium-screenshot-<counter>) under the specified save directory.
Example: Capture Page screenshot | 20160925001
Checkbox should be Selected
arguments:[Locator]
Verifies checkbox identified by ' Locator ' is selected/checked.
Key attributes for checkboxes is ' id ' and ' name '. See ' Introduction ' For details about locating elements.
Description: The Verify check box is checked/checked.
Example: Checkbox should be Selected | Checkboxidorname
Checkbox should not being Selected
arguments:[Locator]
Verifies checkboxes identified by ' locator ' are not selected/checked.
Key attributes for checkboxes is ' id ' and ' name '. See ' Introduction ' For details about locating elements.
Description: The Verify check box is not checked/checked.
Example: Checkbox should not being Selected | Checkboxidorname
Choose Cancel on Next Confirmation
Arguments:[]
Cancel'll be selected the next time ' Confirm Action ' is used.
Description: Select "Cancel" in the pop-up box with "OK/Cancel" and need to be combined with the keyword (Confirm Action).
Example:
Choose Cancel on Next Confirmation
Confirm Action #选择 "Cancel"
Choose File
arguments:[Locator | file_path]
Inputs the ' file_path ' into file input field found by ' identifier '.
This keyword are most often used to input files into upload forms. The file specified with ' File_path ' must was available on the same host where the Selenium Server is running.
Description: Select the file. On the upload page, use the keyword directly. Or in combination with a keyword (get file).
Example:
Choose File | xpath=//div[@class = ' pd6 dot fcb ']/span/input | C:\\Documents and Settings\\xxx\\my Documents\\my pictures\\bug5.png
Choose File | Get File | C:\\Documents and Settings\\xxx\\my Documents\\my pictures\\bug5.png
Choose Ok on Next Confirmation
Arguments:[]
Undo the effect of using keywords ' Choose Cancel on Next confirmation '. Note that Selenium ' s overridden window.confirm () function would normally automatically return true, as if the user had Manu Ally clicked OK, so your shouldn ' t need to use this command unless for some reason you need to change your mind prior to th E Next confirmation. After any confirmation, Selenium would resume using the default behavior for future confirmations, automatically returning True (OK) Unless/until you explicitly use ' Choose Cancel on Next confirmation ' for each confirmation.
Note that every time a confirmation comes up, you must consume it by using a keywords such as ' Get Alert Message ', or else The following selenium operations would fail.
Note: Select OK in the pop-up box with OK/Cancel.
Example: Choose Ok on Next Confirmation
Click Button
arguments:[Locator]
Clicks a button identified by ' locator '.
Key attributes for buttons is ' id ', ' name ' and ' value '. See ' Introduction ' For details about locating elements.
Description: Click the button. Be aware that clicking on an object must be a button, not a picture, hyperlink, input.
Example: Click button| Buttonok
Click Element
arguments:[Locator]
Click element identified by ' locator '.
Key attributes for arbitrary elements is ' id ' and ' name '. See ' Introduction ' For details about locating elements.
Description: Click on the element. Can be used on any element that needs to be clicked: Buttons, pictures, text, hyperlinks, etc.
Example: Click Element | xpath=//input[@value = ' Baidu a bit '] #点击 "Baidu" button
"Robotframework" selenium2library class Library keyword usage instructions