Menu
  • HOME
  • TAGS

Can't click on Google search button

c#,watin

This appears to be caused by Google's auto complete functionality. Google's home page with nothing typed in the search bar: Google after typing in the search bar, triggering auto complete: Notice that the layout changes. The button whose name is btnK still exists on the page but is invisible. The...

xUnit and Watin cleanup

c#,watin,xunit,resource-cleanup

For this purpose your class with tests need to implement IUserFixture interface. I'll provide the example which solves your needs and demonstrates xunit life-cycle model: public class MyTestClass : IUseFixture<WatinFixture>, IDisposable { private WatinFixture _data; public void SetFixture(WatinFixture data) { _data = data; Console.WriteLine("setting data for test"); } public MyTestClass()...

How to detect new window in watIn

c#,asp.net,watin

If you are trying to get a new window by clicking a link, then use ClickNoWait method for the link. Since Click triggers a wait for call to finish, which will internally checks for the browser state and might throw exception. Please use the below code and check. using (IE...

WatiN extensions for H1 H2 H3 for Form, Browser and Frame

c#,html,watin

It seems I should do it in a different way that is by extending required class and checking inheritance. Best thing is to extend the last derived class and not using the where clause. public static H1 H1(this Form form, string text) public static H1 H1(this Frame frame, string text)...

Interop service does not work with NuGet WatiN

c#,.net,interop,nuget,watin

In the end it was rather simple - I just had to build the solution and copy the DLL from the folder to the project.

Click on Save or SaveAs dialog of file download

c#,watin

I am using IE 11 and was able to download and close the dialog box Automate of file download in IE 11 using c#...

Automate of file download in IE 11 using c#

c#,watin

I was able to download and close the file download dialog box using the below code [DllImport("user32.dll", SetLastError = true)] static extern IntPtr FindWindow(string lpClassName, string lpWindowName); static void DownLoadFile(IE browser) { browser.Link(Find.ByText("download")).ClickNoWait(); Thread.Sleep(1000); AutomationElementCollection dialogElements = AutomationElement.FromHandle(FindWindow(null, "Internet Explorer")).FindAll(TreeScope.Children, Condition.TrueCondition); foreach (AutomationElement element in dialogElements) { if...

How to save dynamic image in WatIn [duplicate]

c#,.net,httprequest,watin

As i understand, the idea is to capture current CAPTCHA image on page in browser to bypass it by some text recognition (btw, strange idea). And no problem to get image url (it is always the same). In this case you can use API to access browser cache. Specifically for...

WatIn SelectList().SelectByValue() return error Run script failed

c#,.net,watin

I found solution.There are Update of IE that released a month ago that conflict with WatIn methods, after removing it i resolve this problem. The name of Update is : security update for internet explorer 11 KB3008923 ...

Embedded Interop Types using WatiN

c#,.net,nuget,watin

I am not sure if using WatiN for unit testing is a great idea. We used WatiN for browser testing but decided to move to selenium. This was mainly because Watin has not been updated since 2011. However in order to change the EmbedInteropType to false. In your project expand...

How to find a JavaScript alert that is already open with WatiN

javascript,c#,internet-explorer-8,watin,specflow

Let me write a more complete example of this for you: public partial class Form1 : Form { // // Your class properites/variables // AlertDialogHandler dialogHandler; [DllImport("User32.dll")] public static extern Int32 FindWindow(String lpClassName, String lpWindowName); // // Some methods/functions declarations // public void SomeInitMethod() { dialogHandler = new AlertDialogHandler() browse.AddDialogHandler(dialogHandler);...

How to set focus to browser window using WatiN

c#,.net,wpf,internet-explorer,watin

I stumbled upon this solution a while back by looking through the methods brought up by Visual Studio's Intellisense for the IE class. using (var browser = new IE(someAddress)) { browser.BringToFront(); // ... Your other code } The IE#BringToFront() method essentially sets focus to the window. Another common task is...

Watin. how to show invinsible class

show,hidden,watin

There would be a JavaScript function, which gets executed when you manually enter the data in the text field.Go through the Java Script functions on the same page which refer to that element using it's ID NewCardOrAccountNumber. Refer to this link for sample application. Where msg_to is element, and has...