Selenium WebDriver getText

后端 未结 8 2093
广开言路
广开言路 2021-01-06 21:07

I have a

0
.

I try to write a test that myDiv has 0 text in it. With WebDriver it is:

<
相关标签:
8条回答
  • 2021-01-06 21:44

    I just need use a real browser for my webDriver:

    webDriver = new FirefoxDriver();
    

    Then it works.

    Maybe it is a JavaScript issue.

    0 讨论(0)
  • 2021-01-06 21:44

    In Selenium 2, I used this, and it works for me fine.

    driver.getPageSource().contains(text);
    
    0 讨论(0)
提交回复
热议问题