Search CLASS element with value in space

Asked

Viewed 427 times

0

I am doing an automation with Selenium C# and the only standard reference of the tag is a class referenced by other classes:

<div class="slds-form-element slds-form-element_readonly">

I’ve tried to:

.FindElement(By.ClassName("slds-form-element slds-form-element_readonly"))

But it returns me an error saying that it is not possible to locate class with spaces

1 answer

1


Use as follows:

findElement(By.xpath("//div[@class='slds-form-element slds-form-element_readonly']"));

Or:

findElement(By.cssSelector("div[class='slds-form-element slds-form-element_readonly']"));

Browser other questions tagged

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