Description returns null arbitrarily on ListView32 rows?

Class library usage, coding and language questions.
ariel.levi
Posts: 1
Joined: Tue Feb 12, 2008 5:19 pm

Description returns null arbitrarily on ListView32 rows?

Post by ariel.levi » Tue Feb 12, 2008 6:34 pm

Hello,

I'm in the process of trying out the RanorexNet library for a project I'm about to start. The experience has been pleasant all in all, but one strange thing that I'm struggling with is that the Description property of objects of type Element which represent rows in a regular windows ListView32 control return null some of the time.

Out of 100 calls to Description on the same element, for example, 5 or 10 times null may be returned. Certain rows may return null consistently for a short while, may return null forever, and may return a meaningful string after one attempt. Voodoo behavior.

The code goes like this:

Code: Select all

m_ListView = myForm.FindClassName("SysListView32");

Element crossRateListElement = m_ListView.Element;

Element[] gridRows = crossRateListElement.FindChildren(Role.ListItem);

foreach (Element currentRow in gridRows)
{
string name = currentRow.Name;
string description = currentRow.Description;

if (description != null)
{
// Use 'description' to extract data
}
I got around this by inserting the 'description != null' check, but now I have reliability problems instead of crashes, and it's certainly not much better.

The problem may be related to one of the following:
1. The code runs runs on a virtual Windows server, meaning the only GUI which is present is the remote desktop based GUI which I see in my own computer.
2. Some list items are out of view, meaning scrolling is required to see them.

Unfortunately, I consider this a major problem since it prevents the library from filling some acute reliability requirements.

Are these issues known? Have they been discussed before? Is there any possibility that the full version will be better at getting at the problem, or is its internal implementation completely similar to that of the evaluation version?

Thanks in advance!

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Post by Support Team » Wed Feb 13, 2008 2:52 pm

If you have many items in your ListView, this problem might be the result of a bug in version 1.3.1 discussed in following thread:
http://www.ranorex.com/forum/problems-a ... -t340.html
If the caching algorithm does not find the element, null is returned.

I just tried to get the Description property of a few ListItems in a loop and that worked perfectly. Could you please try to get the Description property of a single element in a loop and report if the problem arises that way?

If you run your Ranorex code via Remote Desktop, be sure that the Remote Desktop window is open and visible all the time (windows seems to remove the desktop at the remote machine if the Remote Desktop window at the client is invisible/closed). It's usually safer to use VNC.

If the caching bug is not the cause of the problem (please try to read Description of single element in loop), there might be some problem with the underlying control. Please send us information about the ListView you use!

Regards,
Alex
Ranorex Support Team