Forum Discussion
Hi,
Personally I would try to eliminate the "Ambiguous Browser Recognition" warning. Can your testing be done using two different browsers, e.g. Chrome and Firefox?
To avoid iterative calls, you may consider use of public flag like in this pseudo-code:
Public bIsInHandler = False
...
Sub Warning_Suppress(Sender, LogParams)
If (bIsInHandler) Then
Exit Sub
Else
bIsInHandler = True
End If
if SuppressedWarnings.Contains(LogParams.MessageText) then
LogParams.Locked = True
Log.Message("Suppressed warning: " + LogParams.MessageText)
end if
bIsInHandler = False
End Sub
Alright after trying out that fix which in theory should fix it up as it definitely would not allow recursive calls, the system popup still showed up.
Something weird is definitely happening here.
Here is the log when I'm not doing any handler on the event:
Notice that there is only 1 instance of the warning. And no other warnings after it.
But with the handler here is what's happening:
It seems that the OnLogWarning event is being triggered repeatedly causing the handler to be repeatedly be called, though not by the handler itself.. since as the log shows bIsInHandler is False (that's what I'm logging)...
And to make it even weirder, I modified the handler to just be this and it still triggered the system pop up. Based on the original log there should just be 1 warning, so only 1 trigger of the event, unless the event itself is causing another event which seems to be the case...
bIsInHandler = False
set SuppressedWarnings = CreateObject("System.Collections.ArrayList")
SuppressedWarnings.Add "Ambiguous browser recognition."
Sub Warning_Suppress(Sender, LogParams)
Log.Message(bIsInHandler)
If (bIsInHandler) Then
Exit Sub
Else
bIsInHandler = True
End If
'if SuppressedWarnings.Contains(LogParams.MessageText) then
' LogParams.Locked = True
'Log.Message("Suppressed warning: " + LogParams.MessageText)
'Log.Error("TEST")
'end if
'bIsInHandler = False
End Sub
Related Content
- 4 years ago
- 6 years ago
Recent Discussions
- 18 hours ago
- 18 hours ago
- 5 days ago