detect partially shown text in a table cell

Ask general questions here.
mausan
Posts: 4
Joined: Thu Feb 25, 2016 3:02 pm

detect partially shown text in a table cell

Post by mausan » Thu Feb 25, 2016 3:13 pm

Hello Gentlemen,
I have a DevExpress application with some panel where a table is shown.
The headers can be resized to allow the text in the related cells to be shown completely.
I need to check if a text in any of the cell is partially shown in order to trigger an action and enlarge the related column header
Is there any way to do that?
Regards
Maurizio

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: detect partially shown text in a table cell

Post by odklizec » Fri Feb 26, 2016 9:20 am

Hi Maurizio,

Could you please upload a Ranorex Snapshot(not screenshot) of the element in question? Without snapshot, it's pretty hard to suggest something reliable.

Generally speaking, I'm sure there is not a built-in way to detect a partially displayed text. Your only hope is to write a custom method to detect such behavior. Unfortunately, without snapshot, it's impossible to tell how to detect partially displayed text.

I can only guess that the partially displayed text contains three dots at the end of string (like "partially displ...")? So all you have to do is to loop through the table, examine each cell and check the presence of "..." characters. If found, enlarge the appropriate column. You will probably have to enlarge the column in a loop and small increments. After each enlargement, you will have to re-check the presence/absence of "..." characters in originally found cell.

Hope this helps? ;)
Pavel Kudrys
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

mausan
Posts: 4
Joined: Thu Feb 25, 2016 3:02 pm

Re: detect partially shown text in a table cell

Post by mausan » Thu Mar 03, 2016 10:57 am

Thanks a lot odklizec
I'm not sure I can get snapshot, the application I'm working on is a 3rd party DevExpress application and I do not want to infringe any intellectual property.
But youy guessed right, I have cell in a table where I can see incomplete text ending with the 3 dots.
So you say it is possible to detect what is actually shown and not what is the complete text.
Do you have the possibility to send me the the exact C# property of the Cells.Element object I can look for for this purpose?
I have to say I did not check deep but I'm sure in Spy I could only see complete text exposed.
Regards
Maurizio

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: detect partially shown text in a table cell

Post by odklizec » Thu Mar 03, 2016 2:10 pm

Hi Maurizio,

I'm afraid, I can't send you the exact code to solve your problem. Even with snapshot, it would be too complicated and time consuming to provide you with precise code. And I'm afraid, I can't spend so much time with just one problem. My help here at Ranorex forum is not my actual work. I hope you understand? ;)
Pavel Kudrys
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

mausan
Posts: 4
Joined: Thu Feb 25, 2016 3:02 pm

Re: detect partially shown text in a table cell

Post by mausan » Fri Mar 04, 2016 10:04 am

gotcha, thank a lot for your support so far Pavel
Cheers
Maurizio