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
    Aug 2011
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to click OK button in the Confirmation box

    Confirmation box appears with OK and Cancel buttons. How can I click OK button? Should I specify new process, new window or something else?

  2. #2
    Moderator tristaanogre's Avatar
    Join Date
    Mar 2006
    Location
    Pennsylvania, USA
    Posts
    1,792
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to click OK button in the Confirmation box

    I'm not sure I understand the question.

    If the confirmation box is part of the application under test, there should not need to be a new process. As it is a new window from what you're already working with, then you will need to reference it seperately.

    A standard example would be something like

    <font class="small">Code:</font><hr /><pre>function test()
    {
    var p = Sys.Process("MyApp")
    var w1 = p.VCLObject("MyForm")
    var w2 = w1.VCLObject("OKButton")
    w2.ClickButton()
    }</pre><hr />

    This is rather simplistic but I think you get the idea...
    -Robert Martin
    Automated Testing Evangelists
    TestComplete "expert"
    Definition expert - noun - Unknown drip under pressure

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

    Re: How to click OK button in the Confirmation box

    Sorry, I am novice in scripting.

    There are some rows from my script:

    Set Browser = TestedApps.iexplore.run()
    Set Page = Browser.ToURL(ProjectSuite.Variables.ServerURL)
    ...

    'I can click Delete button
    Page.NativeWebObject.Find("innerText","*Delete*"," SPAN").Click

    'I can not click OK button in Confirmation window. Next Row does not work:
    Window.NativeWebObject.Find("Button", "OK", 1).Click

    Could you, please, explain my mistake?

    Thank you,
    Mona

  4. #4
    Moderator tristaanogre's Avatar
    Join Date
    Mar 2006
    Location
    Pennsylvania, USA
    Posts
    1,792
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to click OK button in the Confirmation box

    Try removing the "NativeWebObject" portion from your link where you're clicking the OK button.
    -Robert Martin
    Automated Testing Evangelists
    TestComplete "expert"
    Definition expert - noun - Unknown drip under pressure

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

    Re: How to click OK button in the Confirmation box

    I have Run-time error: Window object is required.
    What I should specify for that?
    Set Window = ?

    Please, help me,
    Mona

  6. #6
    Moderator tristaanogre's Avatar
    Join Date
    Mar 2006
    Location
    Pennsylvania, USA
    Posts
    1,792
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to click OK button in the Confirmation box

    Without knowing your application, I can't necessarily say what to set Window to. Most likely it will be something like

    Set Window = Page.something.

    A recommendation:

    As a novice scripter, try using the Record feature to record a script and see what it ends up with. Then, make the necessary modifications to your code to match what the recording discovered
    -Robert Martin
    Automated Testing Evangelists
    TestComplete "expert"
    Definition expert - noun - Unknown drip under pressure

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

    Re: How to click OK button in the Confirmation box

    Thank you.
    It works now.
    I used Sys.Process... from your first answer.

    Mona

 

 

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 01:52 AM.

Copyright BetaSoft Inc.