Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 对话框在60秒内不可用_Visual Studio_Nunit_Watin - Fatal编程技术网

Visual studio 对话框在60秒内不可用

Visual studio 对话框在60秒内不可用,visual-studio,nunit,watin,Visual Studio,Nunit,Watin,我试图在一个函数中使用对话框处理程序两次。它第一次执行得很好,但第二次挂起系统,对话框打开,显示Ok和Cancel butoon,但始终无法单击它。它还会超时,并出现错误“对话框在60秒内不可用” 在我的代码中的两个位置使用这个函数,第一次执行得很好,第二次在同一个函数中它给出了对话框不可用,而它是可用的错误。我最好的猜测是,在第二次调用时,您再次调用它 ie.AddDialogHandler(cdhPopup),从而第二次注册它,在调用处理程序时不知何故导致程序崩溃(可能是跨线程访问内部变量?

我试图在一个函数中使用对话框处理程序两次。它第一次执行得很好,但第二次挂起系统,对话框打开,显示Ok和Cancel butoon,但始终无法单击它。它还会超时,并出现错误“对话框在60秒内不可用”


在我的代码中的两个位置使用这个函数,第一次执行得很好,第二次在同一个函数中它给出了对话框不可用,而它是可用的错误。

我最好的猜测是,在第二次调用时,您再次调用它
ie.AddDialogHandler(cdhPopup)
,从而第二次注册它,在调用处理程序时不知何故导致程序崩溃(可能是跨线程访问内部变量?)


您应该检查处理程序是否已注册,只有在未注册时才进行注册。

您能提供源代码的相关部分吗?没有你的回答是不可能的。非常感谢。是的,你说得对。它在注册时崩溃了
Dim cdhPopup As ConfirmDialogHandler 
cdhPopup = New ConfirmDialogHandler() 
If (ie.Button(Find.ById("btnDelete")).Exists) Then
    'Cancel the booking '
    ie.AddDialogHandler(cdhPopup) 
    ie.Button(Find.ById("btnDelete")).ClickNoWait() 
    cdhPopup.WaitUntilExists() 
    cdhPopup.OKButton.Click() 
    ie.WaitForComplete() 'Wait for page to finish loading '
Else 
    Assert.Fail("Could not found the Cancel Button") 
End If