watin

Uploading File in WatiN

How do I upload a file using WatiN? Is it possible for this file to reside on a web server (as oppose to it being on user's machine)? Code snippet is highly appreciated. Thanks. ...

Unit Testing with WatiN and NUnit

It seems that the common theme among SO questions regarding WatiN have to do with actually getting the thing working and I'm no exception. I've downloaded the latest release of WatiN (2.0.20.1089) and am trying to create the NUnit / WatiN equivalent of Hello, World: using WatiN.Core; using NUnit.Framework; namespace Foo.Browser.Tests ...

WatiN: MsHtmlBrowser will not TypeText

From the WatiN website: // Open a new Internet Explorer window and // goto the google website. IE ie = new IE("http://www.google.com"); // Find the search text field and type Watin in it. ie.TextField(Find.ByName("q")).TypeText("WatiN"); // Click the Google search button. ie.Button(Find.ByValue("Google Search")).Click();...

watin - saving a generated excel sheet

Hello. I have a Watin script that logs into a site and generates a report in excel format. I'm having a really hard time saving the generated excel file. I thought my answer was using the GetActiveObject method in interop services. I don't get an error using that, but it doesn't seem to find it either. More info if it's any use: Th...

Watin OwnTableCellCells.Count index out of range sometimes

Hi I'm using 20.20.1089, and I'm getting an exception sometime while looping over like this foreach (TableRow row in table.TableRows) { for (int i = 0; i < row.OwnTableCells.Count ; ++i) { // EXCEPTION INDEX OUT OF RANGE TableCell cell = row.OwnTableCells [i]; } } Under the debugger, row.OwnTableC...

Does Selenium or WatiN have property like QTP's Setting.WebPackage("ReplayType") = 2?

There are some buttons and menus in the application I am testing that require actual clicks to send all the information through and FireEvent style clicking does not seem to cut it. Both TestPartner and QTP can use actual clicks. TestPartner does this always (slow) and QTP does this by changing the 'ReplayType' to 2 from 1. Setting.We...

Is there a browser-agnostic way to detect client-side script errors with Watin?

We're using WatiN to test our web portals. During the course of an E2E test, we'll occasionally see client-side script errors on the IE status bar. I'd like to chain a handler onto the script error event and record the error for later analysis and bug filing. Problem is, I don't know that there's a global script error event or how to ...

Handling web page dialogues with WATIN

Hi, I have a web page that pops up a web page dialog. How can i handle this using WatiN ? ...

Can I use WatiN with IE's createPopup?

I have a web app that I'm trying to regression test with WatiN. This app uses IE's createPopup() method to provide menus - that's something I have no control over. Can I use WatiN to find and click elements within the popup? A further complication is that this app uses HTML frames and I suspect that even if, in theory, I can get to the...

WatiN does not works with LinkedIn OAuth token Access Form

Does WatiN support redirects? I'm trying to automate testing linked in integration library with WatiN. // url like "https://api.linkedin.com/uas/oauth/authorize?oauth_token=ba826cd4-644a-4709-b2de-bedb7c8fb5b4" using (var ie = new IE(authorizationUrl)) { if (ie.TextField("email-oauthAuthorizeForm").Exists && ie.TextF...

Watin from TeamCity not running as a Windows Service

I'm trying to run Watin from within a TeamCity build, using nUnit. All tests run fine locally. I know you cannot run the full Watin tests (i.e. POST) from TeamCity if it is running as a Windows Service. You must start the build agent from a .bat file. But, I don't want to have to login to the server for it to start. I've tried getting...

WatiN Mouse right button in WatiN

How to use Right Mouse button in WatiN i tried the follwong code but didn't work.. Div div1 = pzDev.Div("AppExplorer"); Span sp1 = div1.Span(Find.ById(new Regex("cl_"))); NameValueCollection eventProperties = new NameValueCollection(); eventProperties.Add("button", "2"); sp1.FireEvent("onmouseover",eventProperties); Thread.Sleep(1000);...

Selenium vs. SimpleTest vs. WatiN

It seems there is very few comparison between Selenium / WatiN and SimpleTest (which has web testing features too). I tried Selenium and found the GUI great to create tests as you can see what's going on and record without typing all commands manually. As for running the tests, Selenium is way more complex than SimpleTest. For SimpleTe...

How to wait for jQuery Ajax requests to complete from WatiN?

I'm writing WatiN tests to test an Ajax web application and have come across a timing issue with Ajax requests. After an Ajax request is triggered by an action on the page, I'd like WatiN to wait until the request is complete before validating that the page was updated correctly. I have a feeling that the solution will involve eval-in...

Heavily use of Watin, IE stay open problem

I'm using Watin in C# console app to crawl websites, there are five console app running at the same time. The reason I partly use Watin as crawler is because a few websites use javascript(or ajax) to set page content. Following is the sample code to get a page comment count: Settings.Instance.MakeNewIeInstanceVisible = false; ...

How to write WATIN scripts for a child window opened with window.open?

I have a main menu window. On clicking any menu item it opens a child window using window.open? I am writing automated test script for this using Watin. How do i write Test script for the child windows. ...

watin attachto Embedded browser

I have a c# windows form project using watin. I would love to attach to the web-browser control on a form, is this possible? Is there any sample code on how to attach to the embedded web-browser control. //Looks like this only works for actual IExplorer instances. window = WatiN.Core.Browser.AttachTo<WatiN.Core.IE>(WatiN.Core.Find.ByTi...

How do you test a jQuery UI Dialog using WatiN?

I can't seem to get a hold of it! First attempt failed: string url = "http://jquery_ui_dialog.aspx"; IE jQueryDialog = IE.AttachTo<IE>(Find.ByUrl(url)); Second attempt failed: Process[] processes = Process.GetProcessesByName("iexplore"); foreach (Process p in processes) { if (p.MainWindowTitle == url + " - Microsoft Internet Exp...

WatiN - How to handle auto complete popup?

We're having an intermittent problem that occurs when running certain integration tests on our continuious integration server.. For some reason, every now and then, we get an autocomplete popup that causes a timeout and ultimately a build failure. Is there an eloquent way to detect the popup and click through it? Thanks! ...

WatiN with Safari

When can we expect WatiN supports Safari Browser too. Any idea to enhance WatiN support to Safari Browser also?? Please let us know on this ...