Run Script method is not working
i am accessing one web page. using QTP script like,
pgenameval = Browser("B").Page("P").RunScript("$(s.pageName)")
but it returns empty value. in view source i am able to see the page name as s.pageName = "pagename"
i need value of the page name. if u know pl guide me to resolve this issue.
I am not sure what you are trying to accomplish. Are you trying to get the name of the page from the Object Repository? Is the name of the displayed on the application?
Are you trying to run something on a page?
I have not seen RunScript used as a method in this way before.
You are mixing everything. $ is used for jQuery. Just because you saw in source s.pageName doesn't mean you can run a script with code "$(s.pageName)" and get the output. If you want to give it a shot then try below 2pgenameval = Browser("B").Page("P").RunScript("s.pageName")pgen ameval = Browser("B").Page("P").RunScript("window.s.pageNam e")