SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Mar 2012
    Location
    Chennai
    Posts
    128
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Run Script method is not working

    Hi,

    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.

    Regards,
    indra

  2. #2
    SQA Knight bklabel1's Avatar
    Join Date
    Sep 2012
    Location
    Kew Gardens, United States
    Posts
    2,596
    Post Thanks / Like
    Blog Entries
    1
    Mentioned
    2 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0
    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.

  3. #3
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0
    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")

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 12.50%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 08:01 AM.

Copyright BetaSoft Inc.