SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Oct 2010
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    QTP10 Script not right?

    HI all I am new to testing and qtp10. I am recording a simple script to test that google search is working or not. It records script as follows:

    With Browser("Google")
    With .Page("Google")
    .WebEdit("q").Set "deepawali"
    .WebButton("Search").Click
    End With
    With .Page("deepawali - Google Search")
    .Link("Advanced search").Click
    End With
    With .Page("Google Advanced Search")
    .Sync
    End With
    .CloseAllTabs
    End With

    Can somebody guide me if the script is right? If not how to get it right?

    Thanks in advance

    jat

  2. #2
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: QTP10 Script not right?

    Is it working or not?

  3. #3
    Junior Member
    Join Date
    Oct 2010
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP10 Script not right?

    Thanks for looking at my post. It is working and it generated code like this before I click stop as follows:

    Browser("Google").Page("Google").WebElement("Make Google my homepage").FireEvent "onmouseover"
    Browser("Google").Page("diwali - Google Search").WebElement("diwali 2010").FireEvent "onmousedown"
    Browser("Google").Page("diwali - Google Search").WebElement("diwali 2010").Click
    Browser("Google").Page("diwali 2010 - Google Search").Link("Advanced search").Click
    Browser("Google").Page("Google Advanced Search").Sync
    Browser("Google").CloseAllTabs


    and once I click stop then code is like this:


    With Browser("Google").Page("Google")
    .WebElement("Make Google my homepage").FireEvent "onmouseover"
    End With
    With Window("Windows Internet Explorer")
    .Restore
    End With
    With Browser("Google")
    With .Page("diwali - Google Search")
    .WebElement("diwali 2010").FireEvent "onmousedown"
    .WebElement("diwali 2010").Click
    End With
    With .Page("diwali 2010 - Google Search")
    .Link("Advanced search").Click
    End With
    With .Page("Google Advanced Search")
    .Sync
    End With
    .CloseAllTabs
    End With

    I'll appreciate if someone let me know what need to be done to get it right.

    Thanks

  4. #4
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: QTP10 Script not right?

    What do you mean here by getting it right? You want to enahcne the script or you don't want these with statemenst to be generated or what?

  5. #5
    Junior Member
    Join Date
    Oct 2010
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP10 Script not right?

    I just want to know that why code changed after clicking stop and why it adds extra words like .end,.sync,end with, as you see lot of difference in these 2 codes.

    Thanks

    Jat

  6. #6
    Advanced Member
    Join Date
    May 2006
    Location
    United Kingdom
    Posts
    742
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP10 Script not right?

    code is same in both of scenario.
    Kindly unchecked the option:
    Tool > Options > General > Automatic generate with statement after recording.

    Also understand that .sync and .end has nothing to do with your script logic , it is for synchronization and ending with statement respectively.

  7. #7
    Junior Member
    Join Date
    Oct 2010
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP10 Script not right?

    Thank you Shukla Ji. I did as you said and code does not change after I clicked stop. Thank you very much for your valuable advice.

    Thanks

    Jawahar

 

 

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 11.54%
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:33 AM.

Copyright BetaSoft Inc.