Micro Focus QTP (UFT) Forums
Web Element object - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Web Element object (/Thread-Web-Element-object)



Web Element object - Charanpreet - 04-13-2011

We have an web element object which looks like text area. We have an Agree button which is disbaled. This button will be enabled only when in web element object users scrolls till end of text. There are scroll bars inside this web element, but they are part of web element only. How can i click or reach the to the last text in this web element o that Agree button will be enabled. Any help will be appreciated. Please note am working with descriptive programming approach.

Thanks.


RE: Web Element object - Jay - 04-13-2011

why dont you directly write the code for agree button click..


RE: Web Element object - Charanpreet - 04-13-2011

Jay boss. Button will be disabled until webeleemnt is read. Anyways I got the solution and its working fine for me. am pasting the code snippet:-
Code:
set WshShell =CreateObject("WScript.Shell")
WshShell.SendKeys "{PGUP}"
Browser(objBrowser).Page(objPage).WebElement(objSpan).Click
sh=Browser(objBrowser).Page(objPage).WebElement(objSpan).Object.getAttribute("scrollHeight")
ch=Browser(objBrowser).Page(objPage).WebElement(objSpan).Object.getAttribute("clientHeight")
For i = o to sh step ch
WshShell.SendKeys "{PGDN}"
WshShell.SendKeys "^{END}" 'CTRL+END KEY
Next
Set objSpan = nothing
Set objBrowser = nothing
Set objPage = nothing