Forum Discussion

Savage's avatar
Savage
New Contributor
5 years ago

How to click on a row in Grid WinFormsObject

Hello, I'm trying to evaluate TestLeft and its potential make a decision for the future. Currently I'm facing with the problem - how to click on a row in grid. To get and map this grid - not a probl...
  • Savage's avatar
    5 years ago

    Alright...  with help of beautiful woman Julia from SmartBear tech support 🙂 I've got now how to deal with it.

    So I want to post here a solution, which probably might be helpful for others.

     

    General logic of such operations is based on TestComplete/TestExecute engine, which  basically TestLeft wraps.

    So, in TestComplete we may use external libraries support, such as DevExpress, here is the same logic. We shall use additional extensions and extend/instruct TestLeft in the following way:

    - for instance

    var devExpress = driver.Options.ObjectMapping["Developer Express Controls"];
    var winForms = devExpress["WinForms"];
    var xtraGrid = winForms["XtraGrid"];

    xtraGrid.AddClassName("Some.Super.Fancy.Class.You.Want.To.Extend"); - where class name most likely will be "ClrFullClassName" which you may find using TestLeft spy

    There is a Dictionary of such objects as "WinForms", "XtraGrid" etc which we may find .... BINGO! in TestComplete documentation 🙂  that's why I couldn't find it in TestLeft docs

     

    Then another a bit not obvious action - we must run the code with added extensions, then TestLeft will be able to see by its spy relative descendants/children

     

    What is also important to say - in that way standard mapping of TestLeft recommended in the documentation and video tutorials, also not fully correct - cause based on the above example instead of IWindow interface we shall use IDevExpressXtraGrid.  Otherwise above AddClass won't work from the point to see all descendants like "patientTableGrid.ClickCell()" etc, also because such methods as ClickCell - it's native implementation of SmartBear

     

    Hope it may help to others 🙂

     

    P.S. also big thanks to Alex Karas, who also spend his time to help me to understand the way.

     

    cheers,

    Ilya