Skip to content

How do I store the text of an element

This example demonstrates how to read a text and store it in a variable.

In the solution shown below, you will see that the text in the header section in HICC application is stored using "storeText" command.

Solution:

# Command Target Value
Storing the Header Text
1 storeText xpath=(//div[@id='pageheadersection']/h1)[1]  header_text

Tips, Tricks, Gotchas & Best Practices:

  • You can reuse the value of the variable using the notation ${<variable name>}.To know more about how to print the value of the variables stored, click here.
  • To understand more about the best practices of initializing a variable, click here.

Feedback and Knowledge Base