watin

Hiding Internet Explorer when WatiN is run

吃可爱长大的小学妹 提交于 2019-11-28 07:39:00
I would like to know how I can prevent Internet Explorer from firing up every time I run my console application which uses WatiN for testing live sites. When I run my console application it fires up internet explore and runs through all the tests that I have created using WatiN. What I want is for my console application to run through these tests using WatiN, but without displaying Internet Explorer starting up and appearing on the screen. I basically want the tests to run without seeing Internet Explorer. The IE class by deafult uses some built in settings for a few features. One of which is

How to use watin with WebBrowser control?

风流意气都作罢 提交于 2019-11-28 01:27:59
Is there any way which would allow me to use watin's functionalities from my web browser control? simply i want to use watin with my web browser control i don't want my application to open a new window ,i need it in my web browser control. If you are using .Net WebBrowser Control you can create WatiN's IE object by using following code: var ie = new IE(webBrowser.ActiveXInstance); But if you do that inside your Form_Load ActiveXInstance will be null. And if you do that for example inside some kind of button_Click the application will hang after you use eg. ie.GoTo . You need to start new

How to use watin with WebBrowser control?

試著忘記壹切 提交于 2019-11-27 19:13:15
问题 Is there any way which would allow me to use watin's functionalities from my web browser control? simply i want to use watin with my web browser control i don't want my application to open a new window ,i need it in my web browser control. 回答1: If you are using .Net WebBrowser Control you can create WatiN's IE object by using following code: var ie = new IE(webBrowser.ActiveXInstance); But if you do that inside your Form_Load ActiveXInstance will be null. And if you do that for example inside

WatiN Error Could not Load Assembly

假装没事ソ 提交于 2019-11-27 18:39:13
I am getting the following WatiN error: Unhandled Exception: System.IO.FileLoadException: Could not load file or assembl y 'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=db7cfd3acb5 ad44e' or one of its dependencies. The located assembly's manifest definition do es not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=db I copied the shDocvw.dll from System32 to the bin directory but still it is giving me the same problems. MoMo UPDATE: This answer was written before Nuget was

How do I get a bitmap of the WatiN image element?

旧街凉风 提交于 2019-11-27 18:37:12
问题 I have some textfields processed and other elements, but I want to get the bitmap so I can save it somewhere on disk. I need to do it directly from WatiN if this is possible. How can I do this? 回答1: I had a similar problem some time ago. Watin can't do this directly but it exposes the mshtml objects needed to get some results. At the time my code was pretty much like this: using System; using System.Collections.Generic; using System.Linq; using System.Text; using WatiN.Core; using WatiN.Core

C# WatiN - Add an AlertDialogHandler to click ok button on every Alert dialog window

你离开我真会死。 提交于 2019-11-27 16:23:52
问题 Hello Those who have used WatiN likely also used DialogHandlers . Well can someone teach me how can i assign a DialogHandler that will handle any Alert Box window.alert() , of a specific IE instance under WatiN control . The DialogHandler only has to click in the OK button for very alert dialog box, in that case i think we need an AlertDialogHandler that basically only has to click the OK button. AlertDialogHandler.OKButton.Click() I've search the web and found a few examples.. But they work

Running Watin on TeamCity

我怕爱的太早我们不能终老 提交于 2019-11-27 13:57:01
问题 I'm trying to run a simple Watin test through TeamCity but the Internet Explorer window is never shown as is usually is via CruiseControl. I get an error that it can't find a text field so something is running. But i can't see what without the window. Is there a specific change to the setup of TeamCity server that I need to do? 回答1: Under Account tab on the Teamcity Agent's Service property window ( services.msc ), check "Allow service to interact with desktop", that will allow local service

Watin Tests fail on CC.Net

半腔热情 提交于 2019-11-27 13:49:46
I'm running Watin tests with xUnit on CC.Net under Windows Server 2003. I have lots of tests that all run fine on development boxes with TestDriven.Net and on the server with the xUnit gui app. However, when CC.Net runs the tests (as part of an MSBuild task) the function ie.ContainsText("some text to find"); never returns the expected value. Other functions and properties on the IE object appear to work fine: Button(...).Click(), TextBox(...).Value, etc. I am aware that the service account needs "Allow service to interact with the desktop". I have tried this running CC service under Local

How to determine if CSS has been loaded?

孤街浪徒 提交于 2019-11-27 12:48:20
How can i Assert that the CSS for a page has successfully loaded and applied its styles in Watin 2.1? ShadowScripter After doing some research and writing up my answer, I stumbled upon this link that explains everything you need to know about CSS, when it is loaded and how you can check for it. The link provided explains it so well, in fact, that I'm adding some quotes from it for future reference. If you're curious, my answer was going to be #2 and a variation of #4. When is a stylesheet really loaded? ... With that out of the way, let's see what we have here. // my callback function // which

WatiN System.IO.FileNotFoundException Interop.SHDocVw

梦想的初衷 提交于 2019-11-27 12:42:07
问题 I have just started to receive the following error when running my WatIn tests. System.IO.FileNotFoundException : Could not load file or assembly 'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=db7cfd3acb5ad44e' or one of its dependencies. The system cannot find the file specified. I have searched the web and tried the following solutions, none of which work. http://linrayusa.blogspot.com/2008/08/vsts-2008-could-not-load-file-or.html WatiN Error Could not Load Assembly http