Forum Discussion

4 Replies

  • Ravik's avatar
    Ravik
    Super Contributor
    Check Property is used to Find the perticlular Item in a Perticular location.

    Suppose you want to check "Google" from www.google.com so you need to write code like.



    aqObject.CheckProperty("Object", "Property", Condition, "Value")



    Object meas that your location - sys.process("Internerexplorer").Panel(0).Cell(1, 0) like that



    Property means that, what you want to be check - InnerText, wText, context ...



    Condition like Equal, notequal, greaterta, lessthen.......



    Value whatever you want to compaire.



    Example-



    aqObject.CheckProperty("sys.process("Internerexplorer").Panel(0).Cell(1, 0)", "InnerText" cmpEqual "Google")





    What it does. It check Google word on Google web site (On perticular location only)



    It Might help you.



    Thanks

    Ravik

  • samuel_1's avatar
    samuel_1
    Occasional Contributor
    it does not take into account whitespaces and new line feed between words...
  • AlexeyK's avatar
    AlexeyK
    SmartBear Alumni (Retired)

    Samuel,


    Try regular expressions and the aqString.StrMatches method.

    After reading your previous message, I'd suggest that you use the following expression in your test:


      welcome[ \n]*john[ \n]*\[[ \n]*Log Off[ \n]*\]


    Here is an example:




    Sub Test

      ' The string that you get in your test

      checkedString = "welcome john [ Log Off ]"

      ' The sought-for regular expression

      searchPattern = "welcome[ \n]*john[ \n]*\[[ \n]*Log Off[ \n]*\]"

      ' Compare strings

      If aqString.StrMatches(searchPattern, checkedString) Then

        Log.Message "Success"

      Else

        Log.Warning "Not found"

      End If 

    End Sub