SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Jul 2001
    Location
    NY, USA
    Posts
    67
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: LIST OF STRING comparison?????

    if you are looking at the count,
    Verify(listcount(List1),listcount(List2)) should work, where List1 and List2 are your two lists of string.

    if you looking at itemwise comparision,
    Verify(listcount(List1[i]),listcount(List2[i])) in a for loop should work.

    I havent tried the above methods. They seem logical to me. Let me know if they work.

    Srikanth




    ------------------

  2. #2
    Member
    Join Date
    Jul 2001
    Location
    NY, USA
    Posts
    67
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: LIST OF STRING comparison?????

    You can try ListFind() for your 2nd question.

    Srik

    ------------------

  3. #3
    Member
    Join Date
    May 2001
    Posts
    56
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: LIST OF STRING comparison?????

    Verify does not return a value.
    Actually what I am trying to do is,

    I want to check the error message.(buy comparing the message.)
    If the messages are different, i want to print "Testcase1--Fail"
    If the messages are same, I want to print "testcase1--Pass".

    Ex:
    list of string lsErrMasg = "Username must provide"

    string sRealMesg = "Username required"

    if (lsErrMasg == sRealMsg)
    Print("Pass")
    else
    Print ("fail")

    I looking something like this.



    ------------------

  4. #4
    Member
    Join Date
    Jul 2001
    Location
    NY, USA
    Posts
    67
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: LIST OF STRING comparison?????

    I agree with you that verify does not return value. Try catching the exception in a do..except block, something like this...

    string = s 'error message'

    do
    verify(list1[i],s)
    logerror('test failed')
    --- exception handling code goes here ---
    except
    print("test pass")
    --- continue with your rest of the code---


    you can use nested do..except block to verify all messages, soemthing like this...

    do
    verify() // first time
    logerror('error message did not match')
    --- error handing routine ---
    except
    print("test pass - first message")
    do
    verify() //second time
    logerror('error message did not match')
    --- error handing routine ---
    except
    print("test pass - second message")
    --- your code in case of success ----

    and so on...

    Trust this helps!!!

    Srik

    PS. remember to instantiate string 's' exactly the way it appears in your error message.

    ------------------

  5. #5
    Member
    Join Date
    May 2001
    Posts
    56
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LIST OF STRING comparison?????

    1.How to compare two List of strings?
    2.How to compare list of string with a string?

    I am looking other than Fuzzyverify.
    Any Help?

    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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 09:07 AM.

Copyright BetaSoft Inc.