Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

XPath is a query language for XML or HTML documents.

Studio actions in the «Browsers» "Browsers" group access elements on the page using their path in the HTML markup. The path to the element is specified in the «XPath» "XPath" parameter of the actions using the XPath language.

...

  1. Create a variable with the data type «String» "String" and set its value to the complete XPath of the element, where the varying part will be replaced with some word.
    Example:


    XPath value:



  2. Choose the action «Replace by Pattern» "Replace By Pattern" from the «Text» "Text" action group.



  3. Fill in the action parameters:
    • Parameter «Text» "Text" - specify the variable created earlier that holds the XPath.
    • Parameter «Regex» "Regex" - specify the regular expression for matching, i.e., the word that needs to be replaced.
    • Parameter «Replacement» "Replacement" - specify the new value for the text to be replaced.
      Example parameter entries:
  4. In the «Result»"Result", specify the XPath of the web element whose XPath needs to be changed.
    Example:
  5. After filling in the «Element» "Element" parameter of any action in the «Browsers» "Browsers" group with the variable whose XPath is specified for saving the result in the «Replace by Pattern» "Replace By Pattern" action, the action will be performed with the modified XPath.
    For a better understanding, let’s consider a use case for dynamic XPath replacement.