use of RunScript method
QTP11.0 has added new method RunScript() under page object of web addin. I could not understand where we'll get to use this method during automation.
If any of you have any idea about the need of running scripts on web pages, please share it.
Re: use of RunScript method
From the QTP help on the RunScript Method:
'This example uses the RunScript method to remove a DOM element from a frame.
'Then it verifies that the frame still behaves correctly when the DOM element is removed.
Browser("MySearchEngine").Page("MySearchEngine").F rame("Web Search").RunScript "var remove = document.getElementById('logo'); remove.parentNode.removeChild(remove)"
'Check that the frame behaves correctly
If Browser("MySearchEngine").Page("MySearchEngine").F rame("Web Search").Image("MySearchEngine").Exist Then
Reporter.ReportEvent micFail, "Failed to remove MySearchEngine logo"