页面确实返回错误的收集警报

时间:2012-12-14 10:32:40

标签: xml nunit htmlunit

当转到页面时,它应该通过警报javascript显示一个消息框。但似乎没有错误(因为我已经更改了检索页面列表所需的xml文件中的innertext,所以应该会发生错误。)

这是aspx页面内的内容:

If list = Null
alert("Sorry there's nothing to retrieve.")

进行测试:

Dim docu As New XmlDocument
Dim path As String = "C:\Hallbjorn.xml"
docu.Load(path)
docu.SelectSingleNode("/Aria/Icelandic").InnerText = "Suburban"
docu.Save(path)

webCLient.getPage("https:/Storyline.com/Character1.htm")
collectedAlerts = New java.util.ArrayList()
webCLient.setAlertHandler(New CollectingAlertHandler(collectedAlerts))

Dim newPage = oldPage.getElementById("background").click
Assert.AreEqual("Sorry there's nothing to retrieve.", Convert.ToString(collectedAlerts))

错误消息应该是警报中的消息。

1 个答案:

答案 0 :(得分:0)

警告处理程序的设置必须在单击转到另一页面的按钮之前进行。