How to verify a Text present in the loaded page through WebDriver

前端 未结 8 851
眼角桃花
眼角桃花 2020-12-15 09:49

I need to verify a Text present in the page through WebDriver. I like to see the result as boolean (true or false). Can any one help on this by giving the WebDriver code?

8条回答
  •  无人及你
    2020-12-15 10:28

    For Ruby programmers here is how you can assert. Have to include Minitest to get the asserts

        assert(@driver.find_element(:tag_name => "body").text.include?("Name"))
    

提交回复
热议问题