Run and fix your Robot

Click the "Run" button in the editor view to run your robot. While running a robot, you are taken to the run view. In this view, you can see all the keywords that get run and any errors from running.

By clicking on the keyword rows, you can see additional details on how each keyword was run in the panel on the right.

If you used the default locator suggestions when building your locator, you will get an error like the one below. Whenever there are errors You might also see other errors, depending on how you set up your keywords and locators.

Run view

If you go back to the editor from the run view, you can return to a previous run from the "Run Results" menu in the top menubar.

Run results

When running robots that interact with the web browser, the browser window closes automatically after the run has completed. If you wish to keep the browser window open, you can go to the code view in the editor and change the line that loads Selenium web automation to Library RPA.Browser.Selenium auto_close=${FALSE}. This prevents the browser window from closing.

Let's fix the error

Our locator for the Leg drop-down failed, because it relied on the id of the element to stay the same, even though it changes every time the web page loads. Let's fix the error in the locator.

Go back to the editor, and click "Edit" (under the menu with three dots) for the leg selection locator, this opens up the Inspector and the web page for the locator.

Robocorp Inspector with a selection

Close the annoying popup on the web page by clicking on "Ok", and then click "Pick Element" in the inspector to select the Leg drop-down again.

Now, instead of using the default locator strategy, select a strategy that doesn't depend on the id, such as XPath "//div[3]/input" and click "Save".

Robocorp Inspector with a selection

When building robots, it is quite common that you need to move back and forth between the run and editor view when fixing errors. In VS Code extensions you have some advanced tools for this that are not yet available in Automation Studio, such as code debugging and interactive console.

Now run the robot again. This time the robot should run without errors and you should get a run result with a picture of your robot.

Successful run

Great work! Robot works now as intended. In the next chapter, we'll have a quick glance at organizing code and working with variables in Automation Studio.