watin

How to cope with 'readonly' and 'selected' attributes in WatiN 2.0 against IE9

六眼飞鱼酱① 提交于 2020-01-25 04:05:25
问题 I'm using WatiN for web testing, and am encountering issues caused by the fact that for the 'readonly' attribute of INPUT elements, WatiN is attempting to parse the value as a boolean , which as far as I can tell is incorrect, as the attribute should be written as follows: <input readonly="readonly" /> When I try to access the TextField.Readonly property from WatiN at runtime, an error is thrown because WatiN attempts to parse 'readonly' as a boolean. I also encountered a similar issue with

Automate Safari web browser using c# on Windows

北慕城南 提交于 2020-01-22 15:27:09
问题 I wondered if anyone had successfully managed, or knew how to automate the Safari web browser on the Windows platform. Ideally I would like to automate Safari in a similar way to using mshtml for Internet Explorer. Failing that a way to inject JavaScript into the running process would also be fine. I've used the JavaScript injection method to automate Firefox via the jssh plug-in. I'm looking to automate the browser using .Net to enhance an existing automation framework WatiN Edit : Whilst I

Silverlight Automation Similar to Watin

谁说胖子不能爱 提交于 2020-01-14 18:49:38
问题 I am considering porting a WPF application to Silverlight. However, the WPF application uses Watin to spawn IE processes and automate certain tasks. My question is if there is a way to automate tasks in Silverlight by spawning popups and performing tasks in them similar to how you would with Watin. 回答1: I haven't tried this tool yet, but it is the closest I've found to Watin for Silverlight. It is WebAii from Telerik and it is a free download. I ran across it the other day and plan to try it

Silverlight Automation Similar to Watin

前提是你 提交于 2020-01-14 18:48:56
问题 I am considering porting a WPF application to Silverlight. However, the WPF application uses Watin to spawn IE processes and automate certain tasks. My question is if there is a way to automate tasks in Silverlight by spawning popups and performing tasks in them similar to how you would with Watin. 回答1: I haven't tried this tool yet, but it is the closest I've found to Watin for Silverlight. It is WebAii from Telerik and it is a free download. I ran across it the other day and plan to try it

Automate of file download in IE 11 using c#

孤人 提交于 2020-01-13 06:26:08
问题 I am trying to get the window handler and press the Save button. I found couple of examples on IE8 & 9. But that code doesn't works on IE 11. const int BM_CLICK = 0x00F5; [DllImport("user32.dll", SetLastError = true)] static extern IntPtr FindWindow(string lpClassName, string lpWindowName); [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool SetForegroundWindow(IntPtr hWnd); [DllImport("user32.dll", SetLastError = true)] static extern IntPtr SetActiveWindow

Access denied error ( Visual Studio and WatiN )

…衆ロ難τιáo~ 提交于 2020-01-11 03:31:05
问题 I'm using the WatiN testing tool with Visual Studio 2005. When I try to select a value from my list box I am getting an "access denied" error. 回答1: I have seen this a lot with select lists recently when using the WatiN 2.0 beta. Instead of using the aSelectList.Select(strText) option, it seems to work better when you do this: ie.SelectList(Find.ById("MySelect")).Option(Find.ByText("Option 1")).Select(); This can also happen when changing an ASP.NET control that cause an auto-postback. The

Error when accessing the Frames in Watin new version 2.1

强颜欢笑 提交于 2020-01-11 03:14:07
问题 Below error is thrown when accessing the ie.Frames in new version of Watin 2.1 Error details: COM object that has been separated from its underlying RCW cannot be used. System.Runtime.InteropServices.InvalidComObjectException: COM object that has been separated from its underlying RCW cannot be used. at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, Boolean& pfNeedsRelease) at mshtml.HTMLFrameElementClass.IHTMLElement_get_tagName() at WatiN.Core.Native

How to use WebAii and WatiN with Same Browser

亡梦爱人 提交于 2020-01-07 02:28:09
问题 I wrote too much tests in watin and all they work. there is a silverlight upload control in a page and I must use webaii to control that. but I don't want to convert all my watin code to webaii. How can I use watin and webaii with one browser tab? 回答1: I have no experience with webaii, but if I were you I'd try this: Use webaii to launch the browser then use the WatiN browser .AttachTo() method to get WatiN to point at the browser that webaii opened. 来源: https://stackoverflow.com/questions

Watin's LogonDialogHandler not working for Firefox 3.6

冷暖自知 提交于 2020-01-07 02:05:12
问题 I'm writing automation scripts for a website using WatiN. when I browse to a particular url, a authentication dialog pops up. I have following code to handle the dialog. This code basically enters the specified // Create a logon dialog handler LogonDialogHandler ldh = new LogonDialogHandler(user, password); browser.DialogWatcher.Add(ldh); browser.GoTo("URL that pops up the authentication dialog"); Now this works just fine in IE. But in Firefox, the dialog appears and nothing happens after

WatiN seems to not find JavaScript alert

非 Y 不嫁゛ 提交于 2020-01-05 08:03:16
问题 I have a web application that, under some conditions, pop up JavaScript alert()s that I need to react to in a WatiN test. Google pointed me at Handling alerts in WATIN from way back in 2007 that seemed promising, and I adapted the example code in that post into the following (anonymized): private void MyAssert(IE browser, WatinHelper helper) { AlertDialogHandler alertDialogHandler = new AlertDialogHandler(); using (new UseDialogOnce(browser.DialogWatcher, alertDialogHandler)) { // DoWrong()