woensdag 12 maart 2008

Released WatiN 2.0 CTP

Update: These code samples will no longer work as off WatiN 2.0 beta 1 and higher

I just released WatiN 2.0 Community Technology Preview! So start automation IE and/or FireFox with WatiN as of today. Read how to get started and download the release here. Be aware that the API can (and there for will) change till the final 2.0 release. Here is an example:

[Test]
public void SearchForWatiNOnGoogleVerbose()
{
    using (IBrowser ie = BrowserFactory.Create(BrowserType.InternetExplorer))
    {
        ie.GoTo(http://www.google.com);
        ie.TextField(Find.ByName("q")).Value = "WatiN";
        ie.Button(Find.ByName("btnG")).Click();
        Assert.IsTrue(ie.ContainsText("WatiN"));
    }


    using (IBrowser firefox = BrowserFactory.Create(BrowserType.FireFox))
    {
        firefox.GoTo(http://www.google.com);
        firefox.TextField(Find.ByName("q")).Value = "WatiN";
        firefox.Button(Find.ByName("btnG")).Click();
        Assert.IsTrue(firefox.ContainsText("WatiN"));
    }
}

A big thanks to Edward Wilde for all the work he has done on integrating FireFox in WatiN! And of course we like to hear what you think of it.

Have fun

Tags van Technorati:

6 reacties:

Unknown zei

Cannot build the core project ?
What about MILHTMLParser ?
What about Thought.Net.Telnet ?

Thanks.

Matt zei

looks like those libraries aren't really needed. I removed the using statements for them and Core built fine.

kumar zei

would it be possible to give any time frame when Watin 2.0 will come out of CTP. and full support for dialog boxes for FireFox 3.0

slaphead99 zei

I must be going insane but, after downloading , referencing, checking, double-checking, double-downloading, I cannot find any of the (new?) classes mentioned in the sample code e.g.:

BrowserFactory
IBroswer


What am I missing? Presumably these puppies are in WatiN.Core?

slaphead99 zei

OK- sorry, I get it now- the sample is not in sync with the assemblies so I need to adapt it. No worries :)

Jeroen zei

@slaphead99: The IBrowser interface and BrowserFactory have been removed from WatiN as of WatiN 2.0 Beta 1 and higher. Added an update with this message to the blogpost as well.

Thanks,
Jeroen