Selecting element with multiple classes in Capybara

后端 未结 1 880
被撕碎了的回忆
被撕碎了的回忆 2020-12-31 17:30

I\'m writing automation code in Capybara with Selenium. I have the following element in my HTML, and I wanna click this element in Capybara.



        
相关标签:
1条回答
  • 2020-12-31 18:11

    You can search an element by xpath

    based on your example, seems like the following should work

    //div[contains(@class, 'classA') and contains(@class, 'classB')]
    

    You could also use css

    (:css, ".classA.classB")
    
    0 讨论(0)
提交回复
热议问题