watin

How to scroll Firefox and IE in WatiN?

孤街醉人 提交于 2019-12-04 05:01:36
How to scroll Firefox and IE in WatiN? You can call the "scrollIntoView" method for either Internet Explorer or FireFox for any given element using the following code: For Internet Explorer: using (var browser = new IE("http://www.google.com")) { var textField = browser.TextField(Find.ByName("q")); var nativeElement = textField.NativeElement as IEElement; nativeElement.AsHtmlElement.scrollIntoView(); } For FireFox: using (var browser = new IE("http://www.google.com")) { var textField = browser.TextField(Find.ByName("q")); var nativeElement = textField.NativeElement as JSElement; nativeElement

How to check if PDF was successfully opened in the browser using WatiN?

為{幸葍}努か 提交于 2019-12-04 03:40:45
问题 I am using WatiN library to do a quick smoke test on a web site after deployment. Among other things, I want to make sure that when I click on a specific link on my page, a PDF is opened in the browser. Clicking the link is easy, but how can I detect if Acrobat Reader was successfully opened in the browser window? I would like to catch situations like 404, server errors, or time-outs... 回答1: Rub, I found one bug report and one feature request on this issue. Both the bug and feature request

failed due to the following error: 800704a6 while trying to read data from a text file in teamcity

坚强是说给别人听的谎言 提交于 2019-12-04 02:15:31
问题 I am running some test cases using teamcity. It is saving the data on a textfile successfully but when I try to read that data from same location it is giving the following error SetUp method failed. System.Runtime.InteropServices.COMException : Creating an instance of the COM component with CLSID {0002DF01-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 800704a6. at WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, LogonDialogHandler logonDialogHandler,

Autocomplete DropDown Menu Testing using WatiN

我只是一个虾纸丫 提交于 2019-12-04 01:42:31
问题 I am using WatiN to test an autocomplete drop down. When a user types in the field after 3 characters have been entered jquery autocomplete is triggered and an un-ordered list is shown. It is mandatory for the user to select from the list. I am unable to make a selection/trigger the autocomplete from the list using WatiN. Here is some of the html the developers have used: <ul class="ui-autocomplete ui-menu ui-widget ui-widget-content ui-corner-all" role="listbox" aria-activedescendant="ui

Functional PDF Testing (Automate Testing of PDF Content)

99封情书 提交于 2019-12-03 17:31:13
问题 I am working on an application where I am writing some automation framework for testing a web application. I am using Watij / Watin for the framework, but have run into a problem with verifying the PDFs generated have the correct content. I know I can use IText or a native PDF library to load up the PDF, but I am wondering if there is already an existing framework dedicated to testing PDF file content? 回答1: it's an interesting problem, but thankfully like most out there, there's someone who

Automate Safari web browser using c# on Windows

送分小仙女□ 提交于 2019-12-03 16:23:31
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 think selenium might be a great choice for automating Safari in certain scenarios, I would like to use

Watin Windows Authentication

久未见 提交于 2019-12-03 15:24:05
I am trying to write Watin tests for an intranet application that uses Integrated Authentication. The web page that I am trying to test prints Page.User.Identity.Name. Here is some of the code from my test: if (Win32.LogonUser(u.UserName, u.Domain, u.Password, 2 /*LOGON32_LOGON_INTERACTIVE*/, 0 /*LOGON32_PROVIDER_DEFAULT*/, out hToken)) { if (Win32.DuplicateToken(hToken, 2, out hTokenDuplicate)) { WindowsIdentity windowsIdentity = new WindowsIdentity(hTokenDuplicate); WindowsImpersonationContext impersonationContext = windowsIdentity.Impersonate(); Console.WriteLine(WindowsIdentity.GetCurrent(

Watin - how to test site with popup pages

我是研究僧i 提交于 2019-12-03 13:08:13
问题 I'm using WatiN (Web Application Testing in .Net) to do integration testing on a Dynamics CRM 4.0 website. CRM uses a lot of popup windows - eg clicking on a Contact in a list opens a new browser window with the Contact's details. I want to test: login to CRM (done) go to the Contact list (done) click on an Contact, thus trigger the popup (done) test functionality within the Contact entity/form (can't do) So I need to get hold of the popped up window. How? Thanks. 回答1: //after the click that

Functional PDF Testing (Automate Testing of PDF Content)

若如初见. 提交于 2019-12-03 06:22:00
I am working on an application where I am writing some automation framework for testing a web application. I am using Watij / Watin for the framework, but have run into a problem with verifying the PDFs generated have the correct content. I know I can use IText or a native PDF library to load up the PDF, but I am wondering if there is already an existing framework dedicated to testing PDF file content? it's an interesting problem, but thankfully like most out there, there's someone who has done it before you. Take a look at http://jpdfunit.sourceforge.net/references/jpdfunit_aShortIntroduction

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

杀马特。学长 韩版系。学妹 提交于 2019-12-03 06:20:59
问题 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-ing JavaScript to register handlers for $.ajaxStart and $.ajaxComplete to track whether requests are in progress. I'll dig into that shortly, but wanted to see if