Skip to content

How to use variable in selector? #1896

Answered by dekiesel
dekiesel asked this question in Q&A
Discussion options

You must be logged in to vote

I didn't find a way to do this in the clicker, so I used javascript

Note: This is for XPath Selectors

automaRefData('variables','mydate')

const date_el = document.evaluate(
  "//div[contains(@aria-label,'"+mydate+"')]",
  document,
  null,
  XPathResult.FIRST_ORDERED_NODE_TYPE,
  null,
).singleNodeValue;
console.log(date_el)
date_el.click();

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dekiesel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant