Running Javascript in QTP - Codoid
Select Page
Codoid Blog

Running Javascript in QTP

Irrespective of the business that your client is in, marketing is an integral part of their operations. In fact, in this day and age of social.

Most awaited feature for Web application automation is implemented in QTP 11.

Yes, it is Running JavaScript snippets during run-time. It is really helpful to trigger a JavaScript function which is attached to an HTML object.

Code

Dim oPage:Set 

oPage=Browser("name:=Google").Page("title:=Google")
Dim oTxtGoogle:Set 

oTxtGoogle=oPage.RunScript("document.getElementsByName(

'q')(0);")  
'The above line gets DOM object for Google textbox 

using Javascript.

oTxtGoogle.Value="qtp"
  

Written By

Submit a Comment

Your email address will not be published. Required fields are marked *


Most awaited feature for Web application automation is implemented in QTP 11.

Yes, it is Running JavaScript snippets during run-time. It is really helpful to trigger a JavaScript function which is attached to an HTML object.

Code

Dim oPage:Set 

oPage=Browser("name:=Google").Page("title:=Google")
Dim oTxtGoogle:Set 

oTxtGoogle=oPage.RunScript("document.getElementsByName(

'q')(0);")  
'The above line gets DOM object for Google textbox 

using Javascript.

oTxtGoogle.Value="qtp"