# Sherpa Designer: Frequently Asked Questions

## What is the reason that the "Check Element Presence" block in the project finds the "Save" button even if it is absent in SAP?

**Question:** In the project, the Robot checks for the presence of the "Save" button in SAP. If it does not find it, it clicks on the "Edit" element.

Unfortunately, the "Check Element Presence" block finds the "Save" element even if it is not there.

<div data-full-width="true"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfsXmokLMq8enrW6UPB3Pykrge_d7SB18zMNwjAJ_MQEZZUdOIm4Zsj7ODQpQ-C9D6NVUW6e0X6HOqCjv-WwW9POUGvW-LREcCGvM1egFQq5TikWqr4XkFeH_mF2YE6BKI6FraOFXW_LhRJRAvJrAkdBeG3?key=awdOn0AMGpq5YZ7h7uKe4g" alt=""><figcaption></figcaption></figure></div>

**Answer:**

Most likely, this element is in the cache of the SAP COM component. Try reconnecting to SAP before checking. For example, using the "Join" or "Select Window" blocks.

## Is there a possibility to automate 1C using hotkeys?

**Question:** Is there a possibility to automate 1C using hotkeys?

**Answer:**

Yes, there is. You can use the cheat sheet from the official 1C website: <https://its.1c.ru/db/v8std/content/430/hdoc>

Or the guide for assigning hotkeys at the link:

[https://1s-portal.ru/index.php/stati/configuration/3-form/76-knopke-naznachit-gorjachuju-klavishu.html#:\~:text=%D0%9D%D0%B0%D0%B7%D0%BD%D0%B0%D1%87%D0%B5%D0%BD%D0%B8%D0%B5%20%D0%BA%D0%BB%D0%B0%D0%B2%D0%B8%D1%88%20%D0%BC%D0%BE%D0%B6%D0%BD%D0%BE%20%D0%B4%D0%B5%D0%BB%D0%B0%D1%82%D1%8C%20%D0%BA%D0%B0%D0%BA,%D0%BA%D0%BB%D0%B0%D0%B2%D0%B8%D1%88%D0%B8%2C%20%D1%81%D1%80%D0%B0%D0%B7%D1%83%20%D0%B6%D0%B5%20%D1%83%D0%B2%D0%B8%D0%B4%D0%B5%D1%82%D0%B5%20%D1%80%D0%B5%D0%B7%D1%83%D0%BB%D1%8C%D1%82%D0%B0%D1%82.](https://1s-portal.ru/index.php/stati/configuration/3-form/76-knopke-naznachit-gorjachuju-klavishu.html)

## Why does the logic of the PowerShell Execute block work differently compared to the built-in PowerShell?

**Question:** Why does the logic of the PowerShell Execute block work differently compared to the built-in PowerShell? And how can it be used correctly in this case? I am trying to use a function – the correct output should be False. When calling this function through the PowerShell block, it returns True (in the second block).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf02OmiACVUlAaFFR03L8oiKl8KP42Wl55OKhgHfBlZfzXifgedKRbkb4rADtcxEQBsvfXnGQqn9ykcejM6h4hBm056RvnVDiO-8vmGK9UPf023EF4ZOVMzqhGL5JAkekT7aU9NdbDu_AhtwczprCJ19iZN?key=awdOn0AMGpq5YZ7h7uKe4g" alt=""><figcaption></figcaption></figure>

The function is declared here:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeAVGlSO1vEun5adPRuC0VhVOXRaJkNLD36ha9-stL5aWPhbAZmGzHDGMHuXmC2lwWDGYkQhVJptlWkK1ArC9zepvp_W1tCEm7I2goU2vqVcqCc6Eeur_oPTU317w_8_pjoEMz3PEB-QEGJh7pW9cIMlEXR?key=awdOn0AMGpq5YZ7h7uKe4g" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeg5J-CFepwYo652piixmB_xEwdWHkMeCJMTJy-minqtVoiT-qrnd9L-IO-PHYiJdWINzzZm4jCNLWCvpbKEAkqbRVLcY788whlvysi2eadiB7mTH9eGSoWxjZ0z06qRsE9EnlfD6fDuL9G72dMDNmmKjg?key=awdOn0AMGpq5YZ7h7uKe4g" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXemoxj-TwvLKdQXWAaMPre0zILVpBQlpFwkuTZB2x7XB256_nqitnetTz0cJ6KjV3IViNRck3cxYvpFlN5xaQV4iTBl9GTm0exdyxLQjrS5Qu-PmFQkpSzAJwW7ErGiqBvizjuruNKQqSOXA70LIct99e8c?key=awdOn0AMGpq5YZ7h7uKe4g" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfcPZDMzRNFP8ExYmbufXIdesXxiFiyPci4hzA0qTr2hZapHM4NPl5RdUq2x2-bdbFhPYnRK8DlH74UNbWZZOe_HYhw4u146TliyJ1mRsQQtG2QfFqHkXILCsZsARnGqe0kOcLOZxe2PwXO3H9640v-MuIR?key=awdOn0AMGpq5YZ7h7uKe4g" alt=""><figcaption></figcaption></figure>

**Answer:**

Use your blocks for such purposes. It is important to understand that everything you write is executed within a function, as each block is a function. As a result, everything you assign in this function will be its local variables. If you are using your code, you should disable variable processing. Currently, all the variables you have written are being converted to local script variables, specifically of this class diagram.

## The "Execute Python Code" block is not working

**Question:** What should I do if there is a problem when using the "Execute Python Code" block?

**Answer:**

The steps are as follows:

1. Close the Designer.
2. Delete the Library folder from the project folder.
3. Download and update the Designer.
4. Make sure you have the x64 version of Python installed.
5. Ensure that the Python version is not higher than 3.12.

## "Selector Not Found" Error

**Question:** When automating a program, there is a task to enter text in the filter field. I am using the "Press Keys" block, the selector identifies the text field and highlights it, but when debugging the robot, the error "Selector Not Found" occurs. Please advise what can be done in this case?

**Answer:**

Most likely, this is related to the fact that by pressing the "Debug" button, you are activating the Designer window, and by clicking, you are returning to the application. Try first to find the ID of the required process and specify it in the text input block, then you will not need to click on the filter field. It is also possible that the click itself and the start of editing in the element change the selector tree of that element. For example, an extra panel or even an editing field that was not there before may appear (or you saw it in the interface, but technically it was not an editing field until you clicked on it). Accordingly, the selectors for the "already clicked" and "not yet clicked" elements are different. Try to record the selector of the passive element that has not been clicked yet and on which the input focus is not set.

## What could be the reason for the error when extracting a range from a table if a variable equal to 1 is used?

**Question:** It is necessary to trim the table (extract a range), but if the column field number=1 – it works. If there is a variable=1 – it gives an error. What could be the matter? The variable is taken from the "Check Value Existence" activity. Additional casting “\_tonumber” does not help.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdh-5p6kiScMD9xNzDh4wupj6AnPyMju727rrJNTqFhaFj_V8AuwJvCgm13XxLv_qdb1eIgTWcxQN_yrydW7pw0XKJyLdMGygbLxLfxO_8kh5bDTUYQRN0yzgfVy9JghrnBZVRclQavBGXYVppySQq17tA?key=awdOn0AMGpq5YZ7h7uKe4g" alt=""><figcaption></figcaption></figure>

**Answer:**

In this case, the variable is of type double. When specifying the column indexer, you can specify either a string or an int32 number. If a variable of type double is specified, the Framework tries to cast it to the required type. Since we can only have two types, it chooses the most suitable one without data loss, which is a string (double => string). As a result, the Framework tries to index the column with "1", not by the number. When you forcibly cast to type \[int], all ambiguities are eliminated for the Framework. Therefore, you should write \[int]$DocCol, i.e., cast the value to an int32 number.<br>

## Can a full script be executed in Sherpa RPA, rather than a one-liner PowerShell script?

**Question:** Can a full script be executed in Sherpa RPA, rather than a one-liner PowerShell script?

**Answer:**

Yes, it is possible; for this, you need to use the "Execute PowerShell Expression" block, disable variable processing in it using the constants #StopRefactoring and #StartRefactoring as follows:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcrCCm24K0fCosN0yBpqYn02Nk8RKdtnIwRMsRT5JSK3QaHPodpQ24eU6GYlBu6xUVoO74Zqk7WZrZLIK5GT1tpFJJ7A0gAEBTEaCSfac5lZD0CAdugY1I4TRpIsO1-bWN85IEulAqkRWoCo2eAHmT9wT-G?key=awdOn0AMGpq5YZ7h7uKe4g" alt=""><figcaption></figcaption></figure>

Insert the code inside them, but then for input or output of variable values outside these constants, you need to assign local variables to script variables.

## **Character Encoding Failure**

**Question:** What should I do if there is a character encoding problem? When encoding on the computer, the encoding is Windows1251 and everything is OK, but on the server in the same file with the same encoding - it fails.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXclqsM9TBi4d4PU4p-5ibEJcQfwvyHkbS0Al13pPo4W4uoFXNOvSELbD38o0i6433G-YIK3VTJ59ITWiz9_zYXJC_R_tDkzSJLhOthJIT3txiHZUYXRepLVfQGKgedUpzxASqAv9Vw_fv-pUaViXvPPFwHM?key=awdOn0AMGpq5YZ7h7uKe4g" alt=""><figcaption></figcaption></figure>

**Answer:**

Character encoding failure may be related to the encoding for Russian versions of Microsoft Windows. If such a problem arises, try the following:

Go to the region settings on your computer (Settings => Time & Language => Region => Additional settings => Regional standards => Advanced => Welcome screen and new user accounts).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcphWjUcbiYjYVlgCfrS4Q8RcbqLPa-y9-shTQXocsozzMA36O5tefWP354ThPLA8AVT3ML0WseSprMVGL_5ndNYvlNhr9UoqY1LEvPfus5lK-_29XRUZn6hb_z2pI8ttRLdijfhyuNPL684KfPn3oFwXdy?key=awdOn0AMGpq5YZ7h7uKe4g" alt=""><figcaption></figcaption></figure>

In the opened window, check the boxes for "Welcome screen and system accounts" and "New user accounts".

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe4F67Sm9GfdNh8NNf87-RRA1G3OGrdFDKxC-bynJkZXgRys1MP1Kct0vDj05EWLHOkcMqjFn796s36Hdml89eLiso9C6JH6sskt9c4vyz4VSYjPd9o8r703kObSlIk6og02jAKiVv3tG4H4m3RZb9KUVSr?key=awdOn0AMGpq5YZ7h7uKe4g" alt=""><figcaption></figcaption></figure>

After that, the interface language for the welcome screen and new user accounts will change to "Russian," and the character encoding failure problem will be resolved.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdzAT2-z8vdM9xrBkKrYfMbrCBjtVrdFyzyjnS4f9C-Jl0SV_uAA5vQVqM2Rq6JSUYSwtRf9OFn5rrgWW8UlPz8G3URZ5U7lrOt0LC3Bqb6V-N0C-adXbvp3hooxa-FVv3iMTrLaArJ0wS5VxtB3zunypQ?key=awdOn0AMGpq5YZ7h7uKe4g" alt=""><figcaption></figcaption></figure>

## How to ignore the number after the word "form" in the ID of the search field on the 1C web page when refreshing the page?

**Question:** There is a problem; on the 1C web page, the ID in the div changes when the page is refreshed. Is there any way to ignore the number after the word "form" and further determine the selector?

For example: `INPUT[id='form1(?)_OutputProductsControlPanelOutputProductsSearchLine_i0']`\
\
**Answer:**

Here are several approaches that may help you solve this problem:

1. ***Using Partial ID Matching:*** You can use a selector that searches for elements by part of their ID. For example, if the ID always starts with "form," you can use the selector `INPUT[id^='form']`, which will find all elements whose IDs start with "form."\
   There are other types of substitutions; more details can be found [here](https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/rabota-v-sherpa-designer/rukovodstvo-po-veb-selektoram/spravochnik-po-notacii-css-i-xpath-selektorov).
2. ***Using Attributes:*** If the element has other attributes that do not change, you can use them to create a more stable selector. For example, if the search field has a class attribute, you can use the selector `INPUT[class='your-class-name']`.
3. ***Indexes:*** If there are multiple elements on the page with the same attributes, you can use an index to select the desired element.
4. ***Using Text Content:*** If the element has text content, you can use it to create a selector.
5. ***Using Parent Elements:*** If the element has a unique parent, you can use it to create a selector. For example, `DIV[class='parent-class'] > INPUT[id^='form']`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/sherpa-designer-otvety-na-chasto-zadavaemye-voprosy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
