This is UltimateRPA Documentation
Default values

Setting default values

UltimateRPA provides several features to help you adjust the default value settings. This enables you to customize the robot's behavior to suit your requirements. We have encountered changes to certain default values in previous examples.

Debugging mode

The function set_debug_mode allows you to run the robot in debugging mode. This is mainly used during script development and debugging. The debug mode does three things while executing scripts. First, the robot inserts a pause between each action (of approximately 1.5 seconds). Secondly, when a GUI or visual element is found, this element is highlighted with a color frame. Thirdly, when the mouse is clicked, a target shows where the click was made. In the example, we will start by finding a text with the Name attribute "ID" in RpaFormsTest, and then we will find it again with the debugging mode enabled.

import urpa
def main():
app = urpa.exec_app("TutorialApps/RpaFormsTest.exe")
app.find_first(cf.text().name("ID"))
app.find_first(cf.text().name("ID"))

The path to an app "TutorialApps/RpaFormsTest.exe" is relative to the script file directory and assumes that the script is placed in the main directory of UltimateRPA tools. If your script is saved elsewhere, remember to change the path.

Search timeout

The methods that search for GUIs or visual elements always have an optional timeout argument, which is 5,000 ms by default. If you wish to change this default value, use the function set_default_timeout, which expects the argument to be an integer type representing a new default timeout. In our example, we will change the default timeout to 10 seconds. The following robotic script finds the text Quantity, which appears 6 seconds after the application is run.

import urpa
def main():
app = urpa.exec_app("TutorialApps/RpaFormsTest.exe")
app.find_first(cf.text().name("Quantity"))

Mouse and keyboard settings

Other functions set the keyboard and mouse behavior set_default_mouse_action, set_default_key_action, set_default_text_action, set_default_keyboard_layout