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 problem, I've got it. But as an entire object. While I don't see any access to the table and strings inside. See below screenshot
In fact this grid has columns with names and in string/cells (not an excel - it's some application)
So getting this grid I need to click no the row by different column names, and I can't understand how to do it. Also it's absent in the documentation
Solved! Go to Solution.
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.
Thank you a lot for the thread update and the solution posted! Much appreciated and is really helpful.
Also let me join with my kudos to Julia who helped with this problem.
P.S. Well, when the solution is known, one can find it in the documentation:
though I agree with Ilya that it is not very obvious where to search for the solution in the documentation.
P.P.S. @JuliaBernikova : Julia, can you consider, if it's at all possible, to provide for TestLeft not only online web documentation but also a compiled .chm version like it is done for TestComplete? The reason for this request is that .chm documentation is much more handy in the meaning of indexing, searching, general contents overview and navigation than the web one.
/Alex [Community Hero]
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.