Html element WatiN Class WatiN Collection Example Version
         

<a />

Link

LinkCollection

Ie.Link(linkId)

0.7

<area />

Area

AreaCollection

ie.Area(Find.ByAlt(alttext))

1.2

<button />

Button

ButtonCollection

Ie.Button(buttonId)

0.9

<div />

Div

DivCollection

Ie.Div(divId)

0.7

<form />

Form

FormCollection

Ie.Form(formId)

0.7

<frame />

Frame

FrameCollection

Ie.Frame(frameId)

0.7

<frameset />

-

FrameCollection

Ie.Frames

0.7

<iframe />

Frame

FrameCollection

Ie.Frame(iframeId)

0.9

<img />

Image

ImageCollection

Ie.Image(imageId)

0.7

<input type=button/>

Button

ButtonCollection

Ie.Button(buttonId)

0.7

<input type=checkbox/>

CheckBox

CheckBoxCollection

Ie.CheckBox(checkboxId)

0.7

<input type=file/>

FileUpload

FileUploadCollection

Ie.FileUpload(fileuploadId)

0.9

<input type=hidden/>

TextField

TextFieldCollection

Ie.TextField(hiddenId)

0.7

<input type=image/>

Button

ButtonCollection

Ie.Button(imageId)

0.7

<input type=image/>

Image

ImageCollection

Ie.Image(imageId)

0.9.5

<input type=password/>

TextField

TextFieldCollection

Ie.TextField(passwordId)

0.7

<input type=radio/>

RadioButton

RadioButtonCollection

Ie.RadioButton(radioId)

0.7

<input type=reset/>

Button

ButtonCollection

Ie.Button(resetId)

0.7

<input type=submit/>

Button

ButtonCollection

Ie.Button(submitId)

0.7

<input type=text/>

TextField

TextFieldCollection

Ie.TextField(textId)

0.7

<label />

Label

LabelCollection

Ie.Label(elementId)

0.7

<option />

Option

OptionCollection

Ie.Select(selectId).Options

1.0

<p />

Para

ParaCollection

Ie.Para(pId)

0.7

<select />

Select

SelectCollection

Ie.Select(selectId)

0.7

<span />

Span

SpanCollection

Ie.Span(spanId)

0.7

<table />

Table

TableCollection

Ie.Table(tableId)

0.7

<tbody />

TableBody

TableBodyCollection

Ie.TableBody(tablebodyId)

Ie.Table(tableid).TableBodies

1.0

<td />

TableCell

TableCellCollection

Ie.TableCell(tablecellId) or

Ie.Table(TableId).TableRows[0].TableCells[0]

0.7

<textarea />

TextField

TextFieldCollection

Ie.TextField(textareaId)

0.7

<tr />

TableRow

TableRows

Ie.TableRow(tablerowId) or

Ie.Table(TableId).TableRows[0]

0.7

All elements, also the ones not mentioned in this list

 

Element and

ElementsContainer

ElementCollection

Ie.Element(elementId)

Ie.Element(tagname, elementId)

0.9


1.2

  有这个表之后很容易得到网页里各种元素对应的类了
  得到类之后查WatiN的帮助,能知道每个类里有些什么函数,方法,怎么控制看具体的类及其方法了。
  
  3.验证结果
  有很多种方法验证结果,因人而异了。不过我用得多的是ie.ContainsText()方法了。
  有了上面的基础,基本上可以用WatiN完成一些常用的,基本的功能测试了。