watin

WatiN browser not displaying PDFs in browser

I'm developing some tests for a website that contains some PDF content. The instance of IE8 created by WatiN does not open the PDFs in the browser, instead asking to download the file. When I examine the list of add-ons for this browser instance, it does not list Adobe PDF Link Helper (it only lists Windows Messenger). When I open IE8...

How to use Watin 64-bit with MSIE 32-bit

Hi, I have a C#-application running on Windows 7. I am using Watin to test some flash and quicktime movies in Internet Explorer. I am running in x64 mode due to some memory limitations I encountered in x86-mode. So I run my application which uses Watin, which starts MSIE. Watin starts the 64-bit version of MSIE. So far so good. The pro...

WatiN LogonDialogHandlers not working correctly in Windows 7

I have recently updated to Windows 7, VS2010 and IE8. We have an automation suite running tests against IE using WatiN. These tests require the logon dialog handler to be used in order to log different AD Users into the IE Browser. This works perfectly when using Windows XP and IE8, but now using Windows 7 has resulted in the Windows S...

WatiN NativeElement.GetElementBounds() - What is the unit of measurement?

When I'm testing with WatiN, I like to save screenshots. Sometimes I don't really need a picture of the whole browser window though - I just want a picture of the element that I'm testing. My attempt to save a picture of an element with the code below resulted in a picture of a block box, because elementBounds.Top points to a pixel posi...

NUnit Test with WatiN, runs OK from Dev10, but when NUnit started from "C:\Program Files (x86)\NUnit 2.5.5\bin\net-2.0\nunit.exe"

I have the following code in an Nunit test ... string url = ""; url = @"http://localhost/ClientPortalDev/Account/LogOn"; ieStaticInstanceHelper = new IEStaticInstanceHelper(); ieStaticInstanceHelper.IE = new IE(url); ieStaticInstanceHelper.IE.TextField(Find.ById("UserName")).TypeText("abc"); ieStaticInstanceHelpe...

How to use WatiN to control browser tabs?

I want to use WatiN with IE in a parallel setting, i.e. work with dozens/hundreds of pages at once. I've tried sticking it into a Parallel.For loop only to see the whole thing crash, so I'm thinking opening multiple tabs in the browser is the way to go. Can someone suggest how this can be done using WatiN (or just some IE-related API) or...

WATIN is there a more effective way to programe this

I want to get all LI with class type equals itempep This is how I do it now, but its very CPU intensive task ElementCollection eL = frame.Elements.Filter(Find.By("tagname", "LI") && Find.ByClass("itempep_hp")); Is there a more efficient way of doing this? TIA ...

waitin closes browsers for all projects that are building.

I'm having an issue running WatiN under CruiseControl.net, where on a .forceclose, watin is closing all open browser instances. I have multiple projects running under cruisecontrol, and its not uncommon for some of those projects to be building and testing at the same time. There has been more than one occasion where watin will close the...

WatiN wait for java script execution completed before click link (IE)

i have this page displaying statement every 2 second (using javascript), at the end of it there is a link which the user can click. with IE it will click the link before javascript generated statement is completed. when i use Link.Click() (with Firefox it will throw exception, which is fine with me) is there a way to wait for javascri...

WatiN Testing and Connection Strings Fiasco

I have a separate project which performs watiN tests. The project is in the form of class library project. When I run test it launches the browser and then uses the Web.config of the Web Application Project which I am testing. The Web.config of web application project has the Dev connection string which should not be used for testing. ...

WATIN simulating right button click in Firefox

Hi, I use the following code to simulate right button click NameValueCollection eventProperties = new NameValueCollection(); eventProperties.Add("button", "2"); box.FireEvent("onmousedown", eventProperties); they work well in IE, but does not work in Firefox, Firefox still recognize the click as left (0) button button. Thanks ...

WatiN two level modal dialog

Hi folks, i am using WatiN lib for automation test. But some case i have to access a modal dialog which is fired another modal dialog. Above code works fine but last line open a modaldialog again. i can not access it with using ie instance.. any idea ? IE ie = new IE("http://localhost/test.htm"); ie.Link("main_lnk1").Cl...

Login in a Webpage with Watin

I try to login on a webpage. On the webpage are two forms with inputs, the inputs have the same Id("username"). How can i get the right inputs to set my text? This is my wrong Code: browser.TextField(Find.ByName("username")).TypeText("test123"); or browser.Form(Find.ByName("form_login")).TextField(Find.ByName("username")).TypeText("...

Using C# WATIN, how do I get the value of a INPUT tag html element?

Using C# WATIN, how do I get the value of the second occurence of a INPUT tag html element on a page? I've tried a whole bunch of things and haven't succeeded. The debugger isn't giving me any obvious way to get element[1] among the 4 that returned. Console.WriteLine(ie.Element(Find.ByClass("myclass")).GetAttributeValue("value") ) ;...

Watin ContainsText method fails to find text in FireFox

The ContainsText method finds the text only in specific area in the html but fails to find id in other parts of the page. The text that located under 'div id="content"' can be found But the text in other area of the html is not found (f.e 'form id="aspnetForm"') Browser b = new FireFox("http://localhost:8668/login.aspx"); ...

WatiN: How to type text in the Body allocated in other Frame

This is link to TinyMCE redactor: TinyMCE I have a task: To type text in the textfield of TinyMCE. But this in not a textfield, this is a Body that doesn't have a method "TypeText();" Please show me the code example, that can type the text in the TinyMCE Body ...

Get list of Javascript methods from C# WebBrowser or WatiN

After a page loads, I'm trying to get a list of all JavaScript methods that exist on that page. I know how to invoke Javascript from C# and C# from Javascript, the problem is that I can't seem to find a way to get the original list of Javascript methods to execute. I need the solution to be available in C# (via WatiN or WebBrowser Cont...

Watin reference problem

When i add watin reference to solution, i can write code, i'm able to see IE class intance methods but when start debugging, it says The type or namespace name 'WatiN' could not be found (are you missing a using directive or an assembly reference?) Then i see nothing about instance methods although " using WatiN.Core; " state...

Watin File Download Problem

When I clicked button with mouse, File Download Dialog opens directly. But when Watin Button Click methods click the vert same button on same ie window this message appears and wait my confirm To help protect your security, Internet Explorer blocked this site from downloading files to your computer. Click here for options. I ...

Use WatiN for automation upload file on the website

I need upload file on the website. But Have a problem, i can't choose file automatic in code. Always browser show me choose file window. What wrong in my code? IE ie = new IE("https://www.xxxx.com/WFrmlogin.aspx"); FileUploadDialogHandler uploadHandler = new FileUploadDialogHandler(@"D:\065-6405_URGENT.xls"); ie.WaitForComplete(); ie.T...