Open adrian2096 opened 5 months ago
The error you have in there is that $data("data/locators").DobleValue.newValue
is a JavaScript object, not a string, so you cannot use the replace
method on it. You need to do the replace on the xpath
property instead:
- script: |
var locator = $data("data/locators").DobleValue.newValue
locator.xpath = locator.xpath.replace("${value}",$macroArgs.plan)
$runMacro("macro", {
locator: locator
});
it works, thanks for the help
hi, im trying to make a dynamic locators like this
data/locators.yaml
the newValue locator is in the data/locators.yaml and im trying to use javascript to replace the '${value}' with a value that i send as a parameter, i try it to use like this but is not working, is there anyway how to make what i want?
Thank you!