Ruby Selenium Web Drive: How to find specific element by xpath div id and css class

后端 未结 3 437
北海茫月
北海茫月 2021-01-27 22:45

I have a below html which am trying to test using ruby selenium web driver

3条回答
  •  独厮守ぢ
    2021-01-27 23:19

    You are specifying a lot of levels in the CSS selector. From the HTML you posted, it doesn't look like you need them all. Using > in a CSS selector specifies a child where using a space signifies any descendant. Any SVG descendant of the DIV should work. You should be able to use just this

    rows = driver.find_elements(:css => "div.container-fluid.container-results svg")
    

提交回复
热议问题