existHTMLElement

Getting started -basics for starting with WinTask

existHTMLElement

Postby Spartacus2010 on Tue Jul 20, 2010 11:50 am

Hello,

The function 'existHTMLElement' recognises a particular object on my form, but what it doesn't seem to recognise is whether that object is visible on the page or not.

The issue I have is that a particular text field becomes enabled/visible on the screen when a certain event occurrs. What I want is a script that informs me that the text field has remained hidden/invisible despite the event occurring. Currently 'existHTMLElement' is happy to tell me an object exists but not the actual state of that object i.e. hidden or not.
Spartacus2010
 
Posts: 1
Joined: Tue Jul 20, 2010 11:39 am

Re: existHTMLElement

Postby TechSupport on Wed Jul 21, 2010 11:31 am

Hello,

There is no direct IsHTMLEnable function. There are different ways to create one depending on the web page design.
Here is an example for an element which can be right clicked:
Code: Select all
Function IsEnable(descriptor$)
local buffer1, buffer2, ret

ret=ExistHtmlElement(descriptor$)

if ret=1 then
'Save the values of those system variables before assigning them
   buffer1=#IgnoreErrors
   buffer2=#ActionTimeout
   #ActionTimeout=10
   #IgnoreErrors=1
   ret=ClickHTMLElement(descriptor$,Right)
   usewindow(top$())
   sendkeys("<Esc>", NoActivate)
   if ret=0 then
      ret=1
   else
      ret=0
   endif
else
   ret=0
endif
'Restore the original values
#IgnoreErrors=buffer1
#ActionTimeout=buffer2
IsEnable=ret
EndFunction

startbrowser("ie","www.wintask.com/demos/form.htm")
UsePage("Form")

res=IsEnable("INPUT RESET[VALUE= 'Submit']")
pause 1
msgbox(res)


ret=IsEnable("INPUT CHECKBOX[NAME= 'contactsoon']")
pause 1
msgbox(res)



If it's not suitable for your web page, thanks to send the url where you want to test the hidden or not element to info@wintask.com and on the real page, we will tell the best way to do it.

Regards.
WinTask Tech Support
TechSupport
 
Posts: 531
Joined: Thu Nov 16, 2006 9:58 am


Return to Getting started

Who is online

Users browsing this forum: No registered users and 1 guest

cron