Selenium WebDriver getText

后端 未结 8 2245
广开言路
广开言路 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:22

    It sounds like you are using HTMLUnitDriver. In that case you would need to enable the JavaScript code like below.

    HtmlUnitDriver driver = new HtmlUnitDriver();
    driver.setJavascriptEnabled(true);
    

    Check out the documentation here.

提交回复
热议问题