Automation Certification Level II - Python

Hi,

I completed Automation Certification Level 1 - Python a while back. I have no knowledge of doing the same thing using Robot framework. I am now trying to complete Level 2 in Python. However, there seems to be a lack of documentation when it comes to Python-based development in Robocorp. Or maybe I am not looking at the right sources. Therefore, seeking help.

Issue: In level 2, for web automation, I used the same library suggested in level 1 course: robocorp.browser. There are cases where clicking on the “Order” button may give you an error message. In such a case, we need to click on the “Order” button again.

Though I have solved this by using try catch, break, and while, I wanted to know if there was a way to:

  1. Check if a certain web UI element/locator/HTML element is available or not using the browser module.
  2. Without using the browser module
  3. Reducing timeout for a particular activity (say page.click())

Also, is there like a Robocorp course using Python for Web Automation?

Note: I am looking for a Python-based solution.

Okay. So I have found a solution (thanks to ReMark).

  1. Check if a certain web UI element/locator/HTML element is available or not using the browser module: We can do something like:

lst_elements = page.query_selector_all(“#order-another”)
We can also use page.query_selector(). If it returns None, the element is not available on the current page.

  1. Without using the browser module - I simply used try, catch with while and break. This worked, too.
  2. Reducing timeout for a particular activity (say page.click()) - The method has a parameter “timeout”. So, we can do something like:
    page.click(“#order-another”,timeout=3000)

This topic was automatically closed 8 hours after the last reply. New replies are no longer allowed.