I am stuck on one of the simple code line and cannot figure out why it is not working. basically I have "Service not-Enable Window" and "Login window" HTML browsers. I have developed the code that If Login Window is currently displayed then call function fnLogin and if Login Window is not displayed then do some thing else.
IF HTMLBrowser("Caption='Login Window'", tpAttachNoWait).exists= TRUE then
HTMLBrowser("Caption='Login window'", tpAttachNoWait).attach
HTMLBrowser("Caption='ervice not-Enable Window'", tpAttachNoWait).attach
NOW The problem is that when TP gets to first line of the statement it fails so I then changes the HTMLBrowser to “Window”.
Like ---> <font color="brown">IF Window(“Caption=’login window’", tpAttachNoWait).exists= TRUE then</font>
That line works fine. But I am confused now because behavior should be the same for the both line but why HTMLBrowser fails and the problem is that I have to user HTMLBrowser. Can any one explain me the difference between both Tags “HTMLBrowser” and “Windows”.
For the Window attach it is likely attaching to the main IE window instead of the HTML browser window within the main IE window. The caption property is likely the same for both. IEWindow would likely work as well, but it doesn't make much sense as to why it doesn't work for the HTMLBrowser.
Ive have tried IEWindow, HTMLBrowser and Window and the only one which does not work is HTMLBrowser and the only time it will work if I use HTMLBrowser("Caption='login window'").attach before the IF statement but the problem if how would I know which one to attach "Login" or "Service not-enable"
I personally believe that TP has an issue with HTMLBrowse + Flag exists logic,
because Flag exists require attach and attach cannot be done until I discover which browser is visible to me. but Window handles this logic very well. well if any one having this problem and got solution then please do speak out.