Forum Discussion

AAN's avatar
AAN
Contributor
12 years ago

Automating Filtering.

Filtering is proving a little tricky with Test Complete.



I filtered with word "Lincoln" but on my automation playback, it did not show a list of filters rather it assumed I had clicked on the Filter first field. Why did it do this and what is the way around this issue?



3 Replies

  • AlexeyK's avatar
    AlexeyK
    SmartBear Alumni (Retired)

    Aneez,


    I guess that you invoked the filter drop-down list by clicking the filter glyph in the column header. I tried to reproduce this behavior and found out that, in my case, TestComplete recorded a wrong horizontal coordinate of the click --


    gridControl.ClickColumnHeaderXY("Quantity", 6, 2); // <--  In my case, 6 is incorrect, it should be something about 60.


    Most likely, you have the same in your test. Try using the coordinate that matches the horizontal position of the filter glyph in your case.

    In my sample case, I resorted to the trivial try-and-fail procedure and after 2-3 attempts, found out that in my case it should be about 58..62, not 6.


    I've registered the issue in our database. Could you please specify which version of the DevExpress WPF grid you are using? I'll add this information to the created bug report.

  • AAN's avatar
    AAN
    Contributor
    Hi Alexei,



    Thanks for your help to date:


    Try using the

    coordinate that matches the horizontal position of the filter glyph in your

    case. - How would I go about doing this?



    In my sample case, I resorted to the trivial try-and-fail procedure and

    after 2-3 attempts, found out that in my case it should be about 58..62, not 6.




    I didn't quite get it sohould be about 58...62 and not 6? What do you refer to specifically in this?



  • AlexeyK's avatar
    AlexeyK
    SmartBear Alumni (Retired)

    >>>> Try using the coordinate that matches the horizontal position of the filter glyph in your case.

    >> How would I go about doing this?

    As I said, I resorted to the trivial try-and-fail procedure:

    * Record a test that only clicks on the filter glyph in the column header.

    * Change the coordinates in the click command.

    * Run the test, see the point of the click. If it is out of the filter glyph, change coordinates, run again to check.


    >>>> In my sample case, I resorted to the trivial try-and-fail procedure and

    >>>> after 2-3 attempts, found out that in my case it should be about 58..62, not 6.

    >> I didn't quite get it sohould be about 58...62 and not 6? What do you refer to specifically in this?

    Aneez, look at the command that TestComplete recorded in my case:


        gridControl.ClickColumnHeaderXY("Quantity", 6, 2);


    The horizontal coordinate is 6. This coordinate does not correspond to the filter glyph, because when I run the recorded test, the command simulates the click on some other place, but not over the filter glyph. The needed coordinate is from 58 to 62. These coordinates correspond to the beginning and ending of the filter glyph. I determined this with the "try-and-fail procedure". In your case, coordinates will be different, because you have another application. That is why, I wrote that you have to find them.