Forum Discussion

vinodtc's avatar
vinodtc
Contributor
13 years ago

When item(HTML) does not support property "innerText"

Hi,



I have written following code for waiting till the specified string apper on page. But some times strangly item(HTML) does not support innerText property showing error like object does not support this property or by giving Exception, VBscript error script is stoppting there itself. Plese suggest why this script is failing?





code:




function fn_WaitForString(str1)


fn_WaitForString(str1)

' msgbox "fn_WaitForString_start"


Success=0


waitTime=0


 


x=sys.Process("iexplore").page("*").Click(10,1)


while (Success <> 1 and waitTime <300)


 


if Sys.Process("IEXPLORE").Exists then


if Sys.WaitProcess("IEXPLORE",1000).WaitPage("*",1000).document.all.WaitItem("HTML",3000).Exists then


txt1= Sys.Process("IEXPLORE").Page("*").document.all.Item("HTML").innerText


end if


 


if instr(txt1,str1 ) <> 0 then


Success=1


end if


 


aqutils.Delay(1)


waitTime=waitTime+1


'msgbox "waitTime:" & waitTime


end if


 


wend


'msgbox "fn_WaitForString_End"



end function


Regards,

Vinod


1 Reply

  • Hi,



    What exact error do you get and in what exact line does it occur? Are there other errors in the log? What is their exact text?