SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Mar 2009
    Posts
    27
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Manually Fail a Test

    Hi,

    How would I manually fail a test?

    for example my test is that if textfield txtY has X inside it
    then I want to fail the test case

    so its something like this

    if txtY.GetText() = "X"
    --> FAIL TEST CASE
    --> return
    else
    --> PASS TEST CASE
    --> return

    thanks

  2. #2
    Advanced Member
    Join Date
    Oct 1999
    Location
    Chicago, IL
    Posts
    652
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Manually Fail a Test

    Look into the 'Verify()' function to see if that is what you are looking for. There is also the LogError() command if you want more control over things.

  3. #3
    Member
    Join Date
    Nov 2007
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Manually Fail a Test

    Hi,

    if txtY.GetText() = "X"
    --> FAIL TEST CASE
    use--> raise 1, "Error message"

    Thus you can manually raise an error and fail a testcase.

    Cheers,
    Rohit S.

  4. #4
    Member
    Join Date
    Apr 2007
    Posts
    77
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Manually Fail a Test

    Hi,

    You can try the below code,

    STRING sText = wWin.wTextField.GetText()

    if MatchStr("X", sText)
    LogError("Test failed)
    else
    Print("Test Passed")

    That way you can search for the specific pattern in the retrieved string.

    Hope this helps.

    Thanks,
    _D

  5. #5
    Junior Member
    Join Date
    Mar 2009
    Posts
    27
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Manually Fail a Test

    Yeah, thanks people LogError done the trick!

 

 

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 10.00%
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 12:30 AM.

Copyright BetaSoft Inc.