Sirs,
I have a table that has been given me by the developers. In Rx Spy I have a definition of
container[@controltype='System.Windows.Forms.TableLayoutPanel']
In my user code I want to find out how many rows are in the table (it is populated from a DB) and click the control at (column, row).
When I define my usercode from the recording, I choose to pass the container defined above as an adapter or RepoItemInfo parameter.
The main issue I have starts right at the beginning as I cannot work out in my usercode how to cast the RepoItemInfo to System.Windows.Forms.TableLayoutPanel so that I can check the RowCount Property, for example.
I just want to do something like ClickOnTable(Row, Column, TableObject).
Can someone advise what to do?
I have not coded for a long time and this escapes me.
Using System.windows.forms.tablelayoutPanel in usercode
Re: Using System.windows.forms.tablelayoutPanel in usercode
Just to add to this ... Here is my usercode attempt ...
I get an error on compiling
Cannot convert type 'Ranorex.TabPage' to 'SystemWindows.Forms.TableLayoutPanel' (CS0030)
I am passing Table as Adapter but have tried RepoInfoItem with exactly the same result.
Can anyone point me in the right direction?
Code: Select all
public void SetRowAndColumn(int Row, int Column, Adapter Table)
{
ProjectRepository myRepo = ProjectRepository.Instance;
CheckBox myCheckBox = ((SystemWindows.Forms..TableLayoutPanel)myRepo.ConnectionForm.DesignerPanel.Table).GetControlFromPosition(Column, Row) as CheckBox;
Cannot convert type 'Ranorex.TabPage' to 'SystemWindows.Forms.TableLayoutPanel' (CS0030)
I am passing Table as Adapter but have tried RepoInfoItem with exactly the same result.
Can anyone point me in the right direction?
Re: Using System.windows.forms.tablelayoutPanel in usercode
Hi,
At first, please post a Ranorex snapshot (NOT screenshot) of the problematic element and full xpath as you have it stored in repository. This would help us to understand your UI and eventually, provide a reasonable answer. Without seeing, at very least, a Ranorex snapshot, it's more or less a guess work. Thanks.
And please, delete the duplicated post you created here:
viewtopic.php?f=13&t=19516&p=66255#p66255
Making multiple posts about the same problem does not help with faster answer
At first, please post a Ranorex snapshot (NOT screenshot) of the problematic element and full xpath as you have it stored in repository. This would help us to understand your UI and eventually, provide a reasonable answer. Without seeing, at very least, a Ranorex snapshot, it's more or less a guess work. Thanks.
And please, delete the duplicated post you created here:
viewtopic.php?f=13&t=19516&p=66255#p66255
Making multiple posts about the same problem does not help with faster answer
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Using System.windows.forms.tablelayoutPanel in usercode
Apologies for not deleting the other post. Completely slipped my mind. Done now.
I have attached a snapshot of the TablePanelLayout. The basic requirement is to be able to get a control according to it column and row in the table (regardless of type) and click in the centre of the control or the table cell.
Thanks for your assistance...
I have attached a snapshot of the TablePanelLayout. The basic requirement is to be able to get a control according to it column and row in the table (regardless of type) and click in the centre of the control or the table cell.
Thanks for your assistance...
You do not have the required permissions to view the files attached to this post.
Re: Using System.windows.forms.tablelayoutPanel in usercode
Hi,
Thanks for the snapshot.
Well, at first, you are using a pretty old Ranorex, version 9.3.3. This version is obsolete and no longer supported. Please update to most recent 9.5.1.
At next, the 'table' you are working with is not table at all. At least Ranorex does not recognize it as table (if you mean this element... /form[@controlname='GlobalConfigForm']/?/?/tabpage[@controlname='bodDesignerTP']//container[@controlname='bodTableColumnsTLP'])
Therefore, you cannot work with it as with "Ranorex.Table" element. Luckily for your, there is available RowCount property, from which you can get "table" row count... No code required then. Simply use GetValue action to get the value from RowCount property. Hope this helps?
Thanks for the snapshot.
Well, at first, you are using a pretty old Ranorex, version 9.3.3. This version is obsolete and no longer supported. Please update to most recent 9.5.1.
At next, the 'table' you are working with is not table at all. At least Ranorex does not recognize it as table (if you mean this element... /form[@controlname='GlobalConfigForm']/?/?/tabpage[@controlname='bodDesignerTP']//container[@controlname='bodTableColumnsTLP'])
Therefore, you cannot work with it as with "Ranorex.Table" element. Luckily for your, there is available RowCount property, from which you can get "table" row count... No code required then. Simply use GetValue action to get the value from RowCount property. Hope this helps?
You do not have the required permissions to view the files attached to this post.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration