开发者

Selenium webdriver: What is the substitute for browserbot?

开发者 https://www.devze.com 2023-03-30 02:28 出处:网络
I\'m trying to convert some Selenium HTML tests to use the WebDriver 2.0 framework.According to the web site (http://seleniumhq.org/docs/03_webdriver.html), the WebDriver framework no longer supports

I'm trying to convert some Selenium HTML tests to use the WebDriver 2.0 framework. According to the web site (http://seleniumhq.org/docs/03_webdriver.html), the WebDriver framework no longer supports the "browserbot" Javascript variable. So my question is, how do I convert a command like

<tr>
    <td>verifyEval</td>
    <td>this.browserbot.getUserWindow().s.pageName</td>
    <td>Config_6_Summary_Confirm_EX</td>
</tr>

using WebDriver? 开发者_开发知识库When I run the command

String target = selenium.getEval("this.browserbot.getUserWindow().s.pageName")

commnand, I get an exception stating, "this.browserbot is undefined". Thanks, - Dave


I make a suggestion to following.

String target = selenium.getEval("window.s.pageName")

You can access to 'browserbot' from WebDriver's getEval by "selenium.browserbot".(not "this")

selenium.getEval("typeof(this.browserbot)"); // undefined
selenium.getEval("typeof(selenium.browserbot)"); // object

but, can not use some browserbot function. (I don't know the deference of 'enabled function' and 'disabled function'. sorry)

"getUserWindow()" is disabled. You can use a "window" instead of it.

0

精彩评论

暂无评论...
验证码 换一张
取 消