Man illustrationFlower illustration

Docy

Using “Functions” Activity

Estimated reading: 3 minutes

The “Functions” Activity under the “Applications” component can refresh the page in the previously opened “Open” Activity check whether a field exists on the page or find the number of rows in a table on the page.

Case Examples

With the “Functions” activity, it is possible to access the information on how many different currencies the daily exchange rates are given on the “TCMB” page.

  • Fill in the required fields of the “Applications – Open” activity.
  • The page to work on is set in this activity.
*Application nameTCMBCurrencies*URLhttps://www.tcmb.gov.tr/kurlar/today.xml
*TypeChromeMaximize
Note: * Fields selected with are required, others are optional.

  • Fill in the required fields of the “Applications – Functions” activity.
  • Pay attention to the “XPath” of the table to be used in this step.
*Application name${TCMBCurrencies}*Field
//*[@id=”kurlarContainer”]/table[1]/tbody/tr[position()>1]
Result Variable Namecount*Actionelementcount
Note: * Fields selected with are required, others are optional.

Check “How to Find “Xpath”” to understand the “Field”.


  1. Right click on the page and click “Inspect”
  2. In order to reach the area where the table is located, “divs” and rows are opened one by one in the panel on the right of the screen.
  3. Right click on the first row of the table (“tr”) and click “Copy Xpath”
  • “position()>1” means skip the first “tr”

  • The “Count” variable will return “22” when the process is run.

The “Functions” activity can be used in cases where the page opened anywhere in the process needs to be refreshed and reloaded.

  • Under the “Functions” component, the “Action” part is changed to “refresh”.
  • There is no need to assign any variables during this process.
  • It is enough to enter the “Xpath” of the area on the page that you want to refresh.

The “Functions” activity, it can be used in cases where it is necessary to check whether a field exists on a page.

  • For example, it can control an error message on a page in the process.

In this example, an incomplete entry will be made to check whether the error has appeared. In other processes, these fields can be filled in completely and a control stage can be created with the “Gateway” structure and progress can be made according to this control.

  • Fill in the required fields of the “Applications – Open” activity.
  • The page to work on is set in this activity.
*Application nameFunctionsExist*URLhttps://uyg.sgk.gov.tr/vizite/welcome.do
*TypeChromeMaximize
Note: * Fields selected with are required, others are optional.
  • Fill in the required fields of the “Applications – Set methods” activity.
  • Select the field where “Username” will be entered.
*Application name${FunctionsExist}*Field
//input[@name=”kullaniciAdi”]
*TextRobustaAcademy*Typetext
Note: * Fields selected with are required, others are optional.
  • Fill in the required fields of the “Applications – Mouse actions” activity.
  • Click the login button.
*Application name${FunctionsExist}*Field
//input[@name=”kaydet”]
Wait until loadWait until visible
Note: * Fields selected with are required, others are optional.
  • Fill in the required fields of the “Applications – Functions” activity.
  • If an error is encountered on the screen, the “control” variable changes to “True”, if not, it changes to “False”.
*Application name${FunctionsExist}*Field
/html/body/table[2]/tbody/tr/td/table[1]/tbody/tr/td[2]
Result Variable Namecontrol*Actionexists
Note: * Fields selected with are required, others are optional.
  • To control the flow of the process, the “Exclusive gateway” activity is added under the “Gateways” Component.
  • Fill in the required fields of the arrows connecting to the “Gateways” structure.
Flow condition${control==true}
Default Flow
Note: * Fields selected with are required, others are optional.
Flow condition
Default Flow
Note: * Fields selected with are required, others are optional.
  • Since an error was encountered in the process, the “Control” variable took the value “True” and continued the process in the direction of that arrow.