Couldn’t attach to manually started Firefox 3.6 browser using WatiN 2.0 RC1
When I manually start Firefox and then try to attach to it using Browser.AttachTo(Find.First()) method, this results in exception "Couldn't find an ForeFox window..."
But when I start FireFox by this command in the first cons开发者_如何学Pythonole application: new FireFox(@"http://google.com") and after that try to attach to it using Browser.AttachTo(Find.First()) method in the second console application, it works!
Can anyone explain me why this is happens and how I can attach to manually started Firefox browser?
Win XP SP3, FireFox 3.6.8, jssh-3.6-WINNT.xpi Watin RC1 2.0.20
WatiN uses the JSSH plugin to order to communicate with the FireFox Browser. Whenever you manually launch FireFox, JSSH is not activated.
To manually launch FireFox, you have to use firefox.exe -jssh, to tell FireFox to start JSSH.
When WatiN launches FireFox, it automatically does this for you, which is why it works when you launch FireFox using WatiN but not when you manually start the browser.
精彩评论