开发者

WatiN RunScript fails in FireFox

开发者 https://www.devze.com 2023-03-07 03:06 出处:网络
I have some WatiN tests in IE that I\'m porting to FireFox (3.6, 4.0 not supported yet I think) and I have an error in the following code:

I have some WatiN tests in IE that I'm porting to FireFox (3.6, 4.0 not supported yet I think) and I have an error in the following code:

var browser = new FireFox(_baseUri);
browser.RunScript("alert('hello');")

Even though it runs fine in IE. I 开发者_如何学Cget the error "{"Error sending last message to jssh server: ReferenceError: alert is not defined"}".

I've tried lots of variations without any success. Any ideas?


Turns out I needed

browser.RunScript("window.alert('hello');");

D'oh!

0

精彩评论

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