Forum Discussion

abrar22's avatar
abrar22
Frequent Contributor
9 years ago

aqobject verifying element name

Hi,

 

I am using aqobject to Verfy different WPFObjects on my application. For example:

 

    aqObject.CheckProperty(this.mainelement.WPFObject("this").WPFObject("ComboBox", "", 1),"wText",cmpEqual,"John");

 

In my application there are different Texts which I need to Verify. So the LogFile says wText  equals "John". Nut I need to log something more specic for Verifications. Like Name equals "John" 

 

Is there a way to do that?

 

Thanks

 

 

 

8 Replies

  • Just use an if statement with a log or event message so you can write whatever you like in the log.

     

    For example:

     

    If (this.mainelement.WPFObject.wText = "John" ) Then
      Call Log.Event("This ComboBox contains the word John")
    Else
      Call Log.Error("This ComboBox does not contain the word John")
    End If

     

    Hopefully this is along the right path.

     

    You can also do this using the Wizard using the If and Else statements with a Log.Event/Error.

    • abrar22's avatar
      abrar22
      Frequent Contributor

      Thanks for the reply 

       

      But I am verifying around 100 different objects in the test, so do i need if else statement for each line? :smileysad: Is there way to name something useful in aqObject.CheckProperty line? 

      • lsainsbury's avatar
        lsainsbury
        Contributor

        Well if the field that displays the object is different and the object property is different then you could either use a switch case statement or an if else both with logging.

         

        If you want specific logging for each output I would assume that this is one of the best ways.

         

        Its not really that much of a problem since once you've written the framework you just need to change the name and the logging to whatever you want.

         

        Plus an if statement will typically execute in about a second so, it'll be quite fast :)