1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
[TestFixture]
public
class
Search : SeleniumBase
{
[Test]
public
void
Search()
{
try
{
string
path =
"Search"
;
CaptureScreen(path,
"HomePage.jpg"
);
selenium.Click(
"link=MAP SEARCH"
);
selenium.WaitForFrameToLoad(SeleniumConfig.GetHostURL +
@"/Search"
,
"100000"
);
//select iframe
selenium.SelectFrame(
"//iframe[@src='/Search']"
);
CaptureScreen(path,
"Map.jpg"
);
selenium.Type(
"id=key"
,
"London"
);
selenium.Click(
"id=searchPoint"
);
Thread.Sleep(5000);
//back to main window
selenium.SelectWindow(
"null"
);
Thread.Sleep(5000);
}
catch
(Exception ex)
{
verificationErrors.Append(ex.Message);
throw
ex;
}
}
|
王德水