Search Widget for <Value> Selenium

Asked

Viewed 209 times

1

I am developing an automation and the site does not define me something standard element, and its class is used in other elements so I would like to search it for its value. it is possible?

<span data-aura-rendered-by="83:6602;a" class="uiOutputText" data-aura-class="uiOutputText">RANCHO RIO CLARO BAR E RESTAURANTE LTDA</span>
  • A suggestion would be to search the html structure for this span, in case there is the Document.querySelector() method - does this satisfy your need? Ai could fetch the parent element first and then reach span

  • by value you mean the text between the tags?

  • @Lucasmiranda..

  • @Bart in vdd until the parent element does not have a standard reference tbm

1 answer

1


Yes, you can search for the element using your text as a criterion.

Use the XPATH language for this as the example below.

var span = driver.FindElement(By.XPath("//span[text()='RANCHO RIO CLARO BAR E RESTAURANTE LTDA']"));

Browser other questions tagged

You are not signed in. Login or sign up in order to post.