Forum Discussion
Hi Cdichoso,
I’ve found out that TestComplete 11 returns undefined for EvaluateXPath when nothing was found on a page. Although, according to our documentation, it should report null. I’ve reported this behavior to our R&D team so that they could investigate it.
To avoid this error, you need to use isEmpty function instead of isNull to check if some objects were found on your page opened in Chrome. Here is the modified code:
Sub Test5() Dim page, arr, i Set page = Sys.Browser("*").Page("*") arr = page.EvaluateXPath("//INPUT[contains(@name, 'CardNumber')]") If not isEmpty(arr) Then arr(i).SetText("X") Else Log.Error "Nothing was found." End If End Sub
Thank you for forwarding my concern. Please do let me know when this gets resolved or updated from your R&D team.
Also, thank you for the isEmpty() suggestion. We figured that one as well when the msgbox did not return any value.
- TanyaYatskovska10 years ago
Alumni
Hi Cdichoso,
I was informed that this issue would be fixed in one of the next TestComplete version.
- cdichoso10 years agoNew Contributor
That's awesome. Thanks for the update and do keep me posted.