Re: [Watin-users] Getting Started.
Brought to you by:
jvmenen
|
From: <rke...@ch...> - 2015-05-02 00:54:13
|
Thank you for responding. Here is the complete source for what I am
trying:
using System; using System.Collections.Generic; using System.Linq;
using System.Text; using System.Threading.Tasks; using WatiN.Core;
namespace WatiNDemo { class Program { [STAThread] static void
Main(string[] args) { using (var ie = new
IE("http://bdsdev.alpha.kaplaninc.com/")) { TextField tf =
ie.TextField(Find.ById("Username")); if(tf.Exists)
ie.TextField("Username").Value = "kburton";
ie.TextField("Password").Value = "July231951Kaplan";
ie.Button("login").Click(); } } } }
The 'Exists' is always false. So I don't get the exception but nothing
happens. The web page is staightforward. It is not in a frame.
Using the browser debugger the source of this element looks like:
-----------------------------------------From: "Greg Hile"
To: wat...@li...
Cc:
Sent: Fri, 1 May 2015 20:26:46 -0400
Subject: Re: [Watin-users] Getting Started.
Try something like. . .
TextField tf = ie.TextField(Find.ById(“Username”));
If(tf.exists)
{
tf.Value = “mystuff”;
}
If it does not exist, then check if it is in a frame or if it’s
input type I not set to a typical type.
FROM: Kevin Burton [mailto:rke...@ch...]
SENT: Friday, May 01, 2015 6:37 PM
TO: wat...@li...
SUBJECT: [Watin-users] Getting Started.
I have a very simple startup application. It is a Windows Console app
that looks like:
Class Program {
[STAThread]
static void Main(string[] args) {
using(var ie = new IE(http://bdsdev.alpha.kaplaninc.com/) [1]) {
ie.TextField(“Username”).Value = “xxxxxxx”;
ie.TextField(“Password”).Value = “yyyyyyyy”;
ie.Button(“login”).Click();
}
}
}
The web page is a very simple web page with two input fields and a
submit button. I have checked that the web page has something like “
Links:
------
[1] http://bdsdev.alpha.kaplaninc.com/)
|