내 배경 :
WatiN을 처음 사용했지만 새로운 웹 UI 테스트를 작성하는 데 익숙하지 않습니다. 새로운 일에서 우리는 WatiN을 웹 UI 테스트에 사용하려고 노력하고 있습니다 (CUIT 실패로 인해).WatiN이 CuteWebUI Uploader 팝업 대화 상자를 처리 할 수 있습니까?
저는 ArtOfTest.WebAii를 사용하여 포함 된 요소의 매직 번호 오프셋을 사용하여 Win32 마우스 클릭을 사용하여이 문제를 해결했지만 WatiN에서이를 수행하는 방법에 대한 문서를 찾지 못하는 것 같습니다 나는 나 자신을 알아낼 수 없습니다 :
내 문제 : \
이 대화 상자가 나타납니다 나는 WatiN 그것을 클릭 할 수있는 방법을 찾을 수 없습니다.
<OBJECT style="FILTER: alpha(opacity=1); WIDTH: 329px; HEIGHT: 100px; mozOpacity: 0.01; opacity: 0.01; mozopacity: 0.01" data="data:application/x-oleobject;base64, <a bunch of data>" width=329 height=100 type=application/x-silverlight-2></OBJECT>
<param name="source" value="/CuteWebUI_Uploader_Resource.axd?type=file&file=silverlight.xap&_ver=634334311861475176"/>
<param name="windowless" value="true" object="" <=""/>
내 테스트 코드 :
[TestMethod]
public void SomeTest()
{
Settings.MakeNewIeInstanceVisible = true;
Settings.AutoStartDialogWatcher = true;
Settings.AutoMoveMousePointerToTopLeft = false;
using (IE ie2 = new IE())
{
ie2.GoTo(URL);
ie2.Link(SomeButtonID).Click();
ie2.Image(AnotherButtonID).FireEvent("onclick");
// some debugging code wrapped around the next user action
// which is clicking on the attach file button
var helper = new DialogHandlerHelper();
using (new UseDialogOnce(ie2.DialogWatcher, helper))
{
Thread.Sleep(1 * 1000); // wait for attach button to be "ready"
// Click button that triggers the dialog that states:
// "file browsing dialog has been blocked"
// "please click here and try again"
//
ie2.Button(FileAttachButtonID).FireEvent("onclick");
}
foreach(string dialogHandler in helper.CandidateDialogHandlers)
{
// nothing prints out here :(
Console.Out.WriteLine(dialogHandler);
}
// debug print out all elements with tagname = object
foreach (Element objectElement in ie2.ElementsWithTag("object"))
{
StringBuilder elementInfo = new StringBuilder();
elementInfo.AppendLine("--------------------------------------------");
elementInfo.AppendLine("element.tagname = " + objectElement.TagName);
elementInfo.AppendLine("element.style = " + objectElement.Style);
elementInfo.AppendLine("element.type = " + objectElement.GetAttributeValue("type"));
elementInfo.AppendLine("element.data = " + objectElement.GetAttributeValue("data"));
elementInfo.AppendLine("--------------------------------------------");
Console.Out.WriteLine(elementInfo.ToString());
// none of these clicks make the dialog go away
objectElement.ClickNoWait();
objectElement.Click();
objectElement.DoubleClick();
objectElement.MouseEnter();
objectElement.MouseDown();
Thread.Sleep(500);
objectElement.MouseUp();
}
// wait to see if dialog disappears after click
Thread.Sleep(300 * 1000);
}
}
일체의 도움이 아주 많이 이해할 수있을 것이다
대화 상자에는 다음과 같은 마크 업을 가지고있다.
감사합니다.
감사합니다! 다른 프레임 워크를 내 코드베이스에 도입하는 것을 멀리하고 싶습니다. 특히 0.2 버전에 있습니다. WatiN이 지정된 픽셀 포인트에서 마우스 클릭을 시뮬레이션 할 수있는 방법이 있습니까? – GraehamF
아니요, WatiN은 지정된 픽셀 지점에서 마우스 클릭을 수행 할 수 없습니다. –