watin

Watin Unit Tests with Nunit Timing problem

Hi i am using WatiN (version 2.0.10.928) with NUnit (2.5.2.9222) if I have something like [Test] public void WebPageTest() { string url = "www.google.com"; IE ie = new IE(url); ie.TextField(Find.ByTitle("Google Search")).TypeText("Watin"); ie.Button(Find.ByName("btnG"))....

Can WatiN disable JavaScript in IE?

Hi I want WatiN to disable JavaScript for some of my tests but can't find any obvious way to do it. Is it possible? I am using IE specifically. Thanks in advance, Ciaran ...

Running automated Web browser tests under Hudson

I'm running Hudson for my automated builds and love it. I'd now like to create automated Web browser tests using either WaTiN (preferred) or Selenium. As my Hudson runs as a Windows service (under Tomcat), how can I configure this to run? Will I be forced to log in as a user on the Hudson box so my automated browser tests will find a ...

Browser.AttachTo method in WatiN to support all browser's child window?

How to get latest trunk revision of WatiN.Core.dll to support "Browser.AttachTo" method? Or is there any other way to support "AttachTo" method (similar to AttachToIE for IE) for Firefox? ...

WatiN - getting past the certificate error page

Anyone know how to use CertificateWarningHandler in WatiN? I've got as far as... IE ie = new IE("https://mysite.aspx"); CertificateWarningHandler cwh = new CertificateWarningHandler(CertificateWarningHandler.ButtonsEnum.Yes); cwh.HandleDialog(new Window(ie.hWnd)); ... which does precisely nothing. On a more general note, how on ear...

Hide all windows for a process (ex. Internet Explorer)

I am using WatiN to script actions in Internet Explorer that run in the background of the user's machine. (I know...hacky). I am able through WatiN to make the Internet Explorer window not show. However, during my script, some HTML dialogs are opened. I am able to hide them using the P-Invoke ShowWindow in User32.dll, but they still ...

Functional PDF Testing (Automate Testing of PDF Content)

I am working on an application where I am writing some automation framework for testing a web application. I am using Watij / Watin for the framework, but have run into a problem with verifying the PDFs generated have the correct content. I know I can use IText or a native PDF library to load up the PDF, but I am wondering if there is ...

Check for opened Browser using WatiN

I want to check if an IE is already opened or not If IE is opened so i.e. Goto("WWW.GOOGLE.COM"); else open new IE and goto Yahoo.com for example: br = new WatiN.Core.IE(@textBox1.Text); then when I press a button I want to check if IE is opened or not and perform the previous scenario. ...

WatiN: The CurrentThread needs to have it's ApartmentState set to ApartmentState.STA to be able to automate Internet Explorer

I am calling WatiN from a C# windows service. When I invoke WatiN it throws the following exception. The CurrentThread needs to have it's ApartmentState set to ApartmentState.STA to be able to automate Internet Explorer I have tried starting up a thread and setting the apartment state via mythread.SetApartmentState(ApartmentState.STA)...

How to create ElementFinder in WatiN?

In WatiN RC1 how can I create ElementFinder which will find any element on page? ...

In WatiN how to wait until postback is complete

in WatiN how can I wait until postback is complete. For example: // Postback response modifies update panel elsewhere on page browser.Text("id").TypeText("asd"); // WatiN doesn't wait until postback is completed (what code should I replace it with?). browser.WaitUntilComplete(); ...

Having problems running WatiN on Windows 7 with IE 8

When I run any WatiN test on Windows 7 with IE8(note that all tests pass on Vista with IE8), the browser displays the first page but does not go any further. The following exception is displayed after a few seconds: WatiN.Core.Exceptions.TimeoutException: Timeout while Internet Explorer state not complete at WatiN.Core.UtilityClasses.T...

default search provider corrupted in IE when running as another user

I am using Watin to do some automated testing and I am running IE as a different user then attaching to the IE instance. The problem is with Internet Explorer. I get a message saying that the default search provider is corrupted. I have reproduced this on two computers. Is there a way of getting around this? Can turn the warnings of...

WatiN IE browser and local javascript files using file:/// protocol

Hi All, I'm currently using WatiN to run some javascript unit tests however everything works fine if I initialise the WatiN IE browser like this: Browser browser = new IE("http://localhost/Project/tests.hyml"); However, as soon as I try to initialise the browser with a file uri, i.e.: Browser browser = new IE("c:\\\\Projects\\Projec...

Selenium locator for <label for="x">

With ASP.NET the tag IDs are pretty volatile so to make my tests more robust I want to locate elements by their label texts. I have played some with WatiN and it does this perfectly but that project seem kind of dead nowadays so I thought I'd look into Selenium as well before I decide on a framework. I have html that looks something lik...

WatiN FindByIdStartsWith?

How to find element by start of id in WatiN? Find.ById(x => x.StartsWith(rel) Didn't work somehow. :/ ...

Detaching a browser from watin

Ok, so I am misusing Watin a bit here, maybe a better tool exists (please do suggest!). Anyway I use Watin to log in to a site, and after that I want it to leave the browser window alone... So my question is: Is it possible to use Watin to execute some steps and then abandon the browser completely? ...

WatiN Loading the ConnectionString from Wrong Configuration File

I am running my WatiN unit test using NUnit and TestDriven.NET. I have a App.config file in my WatiN test project. The connectionstring points to the test database. For some reason when the IE is launched using WatiN it picks up the configuration string in the web.config of the WebApps project which is pointing to the dev database. How...

Software required to automate test cases using WatiN

Hi All, Can anybody please tell me which softwares are required to automate tests of a .NET web application using WatiN. Thanks ...

Iterate Form Fields in WatiN

Is there a way to iterate all form field in WatiN? Code snippet would be highly appreciated. Thanks. ...