Selenium RC find element that have a specific string at the start of the class

StackOverflow https://stackoverflow.com/questions/23650263

  •  22-07-2023
  •  | 
  •  

質問

I have more Items that have the same string in the class name, lets say the string is "dummy", The problem is that I cannot do this with things like tr[class^='dummy'] because this class is under different tags and the class attribute can contain more then one CSS class.

Is there a possibility to identify this elements without using switch to identify them ?

役に立ちましたか?

解決

The solution for this is:

 driver.FindElement(By.CssSelector(".dummy")) 

With this the first element that have this class is returned.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top