Anthony provided what looks like a nice solution to a problem I raised (http://www.telerik.com/automated-testing-tools/community/forums/test-studio/general-discussions/finding-and-clicking-dynamic-buttons.aspx), but when I try to implement it my script fails to run. The log shows this error:
WaitForLogoutButtonAvailable.tstest.vb: Line 81: (BC30491) Expression does not produce a value.
This is the VB sub:
Public Sub WaitForLogoutButtonAvailable_CodedStep()
Dim found As Integer = 0
Dim s As HtmlSpan = Find.ByExpression(Of HtmlSpan)("textcontent=~logout")
While found = 0
If (Assert.IsNotNull(s)) Then
'Stop looking
found = 1
Else
'Wait for '250' msec.
System.Threading.Thread.Sleep(250)
End If
End While
End Sub
I tried exchanging the statement:
If (Assert.IsNotNull(s)) Then
for:
If (Assert.IsNotNull(s) = true) Then
but I get the same result. I also tried with various speechamrks, 1's and 0's. I read the on-line documentation (http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/write-tests-in-code/intermediate-topics/html-control-suite/html-asserts.aspx, and also http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/write-tests-in-code/intermediate-topics/element-identification/findparam-objects.aspx) but the pages don't actually show me what is returned by the assert.
Where am I going wrong?
Thanks,
Nigel Edwards, Transition Computing