watin

Do the SetUp and TearDown methods need [RequiresSTA] if tests have it?

不想你离开。 提交于 2019-12-12 10:49:30
问题 I can run my WatiN tests with ReSharper without issues. Each test has the RequiresSTA attribute and runs fine. When I try run all the tests in the class (TestFixture) I get the following error: One or more child tests had errors Exception doesn't have a stacktrace <testname> ignored: Invalid signature for SetUp or TearDown method: TestSetup <testname> ignored: Invalid signature for SetUp or TearDown method: TestSetup <testname> ignored: Invalid signature for SetUp or TearDown method:

Select each item in dropdown list using Watin

安稳与你 提交于 2019-12-12 05:37:10
问题 I want to iterate through a dropdown list using Watin. The HTML looks like this: <select name="ctl00$Header1$ddlPropertyList" onchange="javascript:setTimeout('__doPostBack(\'ctl00$Header1$ddlPropertyList\',\'\')', 0)" id="ctl00_Header1_ddlPropertyList" onmouseover="this.title=this.options[this.selectedIndex].title" style="width:325px;"> <option selected="selected" value="0185795046:R:GPC:Eligible:F" title="0185795046 - ">0185795046 - </option> <option value="0325844068:R:GPC:Eligible:F" title

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

僤鯓⒐⒋嵵緔 提交于 2019-12-12 01:58:20
问题 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 回答1: string js = "tinyMCE.activeEditor.setContent('tekst');"; browser.Eval(js); 回答2: tinyMce and watin don't play well together. I generally have to use a combination of javascript (using browser.eval ) and the setAttributeValue('value')

Can't install Watin for Visual Studio

寵の児 提交于 2019-12-12 01:42:23
问题 I want to install Wating for Visual Studio 2010. I saw their Video on the website, and followed the steps, but I got some errors while installing NuGet. This is what I did now: New project -> C# Form Project -> Add reference -> Added the Net 4 DLL WatiN.Core.dll Added this code to my project (from their website, which is added to the source below) And I get this errors: 'Form' is an ambiguous reference between 'System.Windows.Forms.Form' and 'WatiN.Core.Form' 'WatiN.Core.Form' does not

how i can click on <td in <table> with WatiN

天大地大妈咪最大 提交于 2019-12-11 21:22:11
问题 I want the mouse move on line that contained onclick method and Click on it How i can do this ??? <table width="100%" class="FormTable" border="0" cellspacing="1" cellpadding="0"> <tbody> <tr> <td> <table border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td width="100" background="/images/tabimage/nrm_bg.gif" nowrap="" onmouseover="this.style.cursor = 'pointer';" onmouseout="this.style.cursor = 'default';" onclick="__doPostBack('HstUnitExchangeLetterSendEdit$tabControl1','1')"> <div

WatIn Add a new option to a Selectlist?

对着背影说爱祢 提交于 2019-12-11 17:34:12
问题 I need to add a new option to a selectList in one of my unit tests, and I can't figure out how to do it. The Dropdown currently has 2 options, I want to add a third, and use it. I tried to use JavaScript injection using http://stevenharman.net/blog/archive/2007/07/10/add-option-elements-to-a-select-list-with-javascript.aspx as a base, but that failed. I get exceptions that crash the IE browser every time, and the text "RunScript failed" gets printed into my logs even though I don't use that

starting my console application at background

倖福魔咒の 提交于 2019-12-11 11:55:42
问题 my client wanted my C# console application which run internet explorer,to start work as a background window plus the internet explorer window that watin opens to be on background. i use visual studio 2005 and watin ver. 2.0.20.1989 . any answer to how i can do this? 回答1: You don't even need to program anything to accomplish this. There's a command line that you can use: start /min YourExecutable.exe No need to write anything in your program at all. This will start any regular console

Problem hiding Internet Explorer in WatiN, even when using Settings.Instance.MakeNewIeInstanceVisible = false

给你一囗甜甜゛ 提交于 2019-12-11 11:54:49
问题 This question is more of a follow-up to this one: Hiding Internet Explorer when WatiN is run Like the person who asked that original question, I also want to stop IE from being shown when my WatiN tests are running, but even when using this setting in a seemingly correct manner (code snippet below), it still ends up showing an empty IE window initially (although it does not show the test behavior/web page interaction). Is it possible to stop the window from showing at all, or is this as good

Key strokes in watin

余生颓废 提交于 2019-12-11 11:32:19
问题 I am trying to get my watin app to push the down key but i cant see how to do it. I have seen it in a previous post you should use : System.Windows.Forms.SendKeys.SendWait("{DOWN}"); but this wont work for me as im using a web browser, any suggestions? 回答1: You need to tell Windows to set it's focus on the Browser Window, and then send the correct key command. For instance, this code snippet will set focus to the browser and send the "DOWN" key to the browser window. [DllImport("user32.dll")]

Watin can't select an option from a select list

别说谁变了你拦得住时间么 提交于 2019-12-11 11:22:36
问题 I am using WATIN to complete a dynamically created form, which can contain several SelectLists (these are javascript controlled picklists). A sample of the select list format outputted is; <select title=" " style="width: 300px;" name="NameHere" data-bind="value: NameHere.AnswerCode" class="fieldInputElement pickList"> <option selected="" value=""></option> <option class="answerTextWithNote" value="A">alpha</option> <option class="answerTextWithNote" value="B" data-guidance="E.g. minor ">bravo