How do I reference a locator in another test step?
Question ID: 420
1
0

Some test steps have a button to find locators but some don’t. How would I refer to a locator from one of those steps? For example if I wanted to write a message using the Console Action, how would I reference a specific locator?

 

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on July 6, 2023 3:46 pm
15 views

Answers (1)

1
Private answer

Each Action in Alchemy has specific types of variables it will use.  If an Action uses a variable of either the Locator or Element type the Alchemy will use the Site infrastructure to select an appropriate locator.  If you want to reference an element on an Action that does not use a locator, you are going to need to extract one or more values from the locator first.  For example, if you wanted to use the text from the element, using the GET action.  By default, that will extract the text.  Now, if there was a specific attribute from the element you wanted to checked, such as HREF, you can pass that as the fieldName to GET and that value will be extracted.

To use that value in a step, you will need to specify an Output Name on the GET step.  An Output Name can be added to any step to store the result(s) of the executed step into a context variable.  Then, you can reference that context variable in any steps that takes input such as your Console Action example.  You can either drag the Context Variable from the data toolbox or use the #{name} format to specify it manually

aj

Marked as spam
Posted by (Questions: 0, Answers: 5)
Answered on July 11, 2023 7:21 am

Welcome to Alchemy Center!
Please Log In to participate in the discussion.

X
Scroll to Top