windev objects

Ask general questions here.
yfrindel
Posts: 11
Joined: Mon Mar 02, 2015 11:50 am

windev objects

Post by yfrindel » Mon Mar 02, 2015 12:10 pm

Hi everybody,

i'm working with windev in my job, and i'm actually trying automations with a 30 days version of ranorex.
It working very well, but i can't access to some specifics objects like a table or a listbox.
For example, i have a table with 2 lines. But when i'm trying to do this "Int32 nbitems = repo.MiseAJourDunePersonne.ListBox.Items.Count;" the function return 4 items containing each one the empty value.
How can i access to the value of each item of the listbox please ?

Please, help me.
Thx

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

Re: windev objects

Post by Support Team » Tue Mar 03, 2015 2:25 pm

Hi yfrindel,

Can you please give us more information about your application. Is it possible to give us access to your application or to post at least a Ranorex Snapshot file.
Please read the section "Creating Ranorex Snapshot Files" in our user guide in order to get a detailed description how to create a Ranorex Snapshot file.
If you don't want to post your snapshot in the forum please send it to [email protected]

Regards,
Bernhard

yfrindel
Posts: 11
Joined: Mon Mar 02, 2015 11:50 am

Re: windev objects

Post by yfrindel » Tue Mar 03, 2015 4:23 pm

Hi,

and thx a lot for your answer.
You can find on attachment the snapshot file you needed.
It will be very well if you have any solution.

Best regards :)
You do not have the required permissions to view the files attached to this post.

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

Re: windev objects

Post by Support Team » Thu Mar 05, 2015 4:13 pm

Hello yfrindel,

Thank you for the snapshot file. It seems that the lines within the table cannot be found. Additionally the control itself seems not to be a table.

I suggest to add the class name to the GDI capture list as shown in the image below.
GDI.png
I hope the elements can be found after doing this.

Regards,
Bernhard
You do not have the required permissions to view the files attached to this post.

yfrindel
Posts: 11
Joined: Mon Mar 02, 2015 11:50 am

Re: windev objects

Post by yfrindel » Fri Mar 06, 2015 11:25 am

Hi Bernhard,

and thank u again for your help.
I tried your advice, and you can see on the screenshot that i can see now (in the ranorex spy) the RawText elements corresponding to the titles and the rows of my table.
It's fine, but how can i get this elements directly by programmation ?
When i try "repo.ValeurDeRachatPerformancesCapital1.ListBox." i don't find any RawText elements.
Can u help me ? I feel that the solution is not so far ! :)

Yannick
You do not have the required permissions to view the files attached to this post.

yfrindel
Posts: 11
Joined: Mon Mar 02, 2015 11:50 am

Re: windev objects

Post by yfrindel » Mon Mar 09, 2015 3:24 pm

i have made a new project with windev. Just a simply window with the mains components.
I tried to fill each component with ranorex, but i have some problems with the listbox and the table.
Do u have some advices for me ?
you can find the project on the attachment of this post.
Thx
You do not have the required permissions to view the files attached to this post.

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

Re: windev objects

Post by Support Team » Tue Mar 10, 2015 4:54 pm

Hello yfrindel,

Thank you for the application.
Did you add the rawtext elements to the repository?
If they are there you should also be able to access them.
Please open the Ranorex Spy within Ranorex Studio or track the elements directly using the Track button in the repository.
AddToRepository.png
or
TrackButton.png
RepoElement.png
It should be possible to access the element using the following line.
var valeur = repo.RanorexTest.Valeur;
Regards,
Bernhard
You do not have the required permissions to view the files attached to this post.

yfrindel
Posts: 11
Joined: Mon Mar 02, 2015 11:50 am

Re: windev objects

Post by yfrindel » Fri Mar 13, 2015 1:50 pm

thx for your response.

It works with the command repo.RanorexTest1.Valeur.RawTextValue, but how can i change the value ?
The RanorexTest1.Valeur.RawTextValue is read only !
And how can i find the number of rows in my table ? (like the Items.count function).
The function ListBox.Items.Count() don't return the right number of rows in my table.
And is it possible to work with a dynamic table ? for example, Is it possible to go through each array element ?
And how can i make a list of all rawtext in the form ?

best regards

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

Re: windev objects

Post by Support Team » Wed Mar 18, 2015 4:57 pm

Hello yfrindel,

I am glad that it works.
May I ask why do you want to change the value?
I would suggest to use a mouse/keyboard action in order to change the value in your data table. If you want to set the value using code, you will need to implement an interface in your application directly. I would not recommend doing that.

The method ListBox.Items.Count() doesn't give you the correct row count because the elements within your ListBox are RawText elements and don't represent the rows only.

A workaround would be to use the last RawText element and check the Row attribute. This should give you the value of the row count.

For example:
/form[@title='Ranorex test']/list[@instance='0']/rawtext[-1]
The following path should give you a list of all RawText elements within your table.
/form[@title='Ranorex test']/list[@instance='0']/rawtext
I hope this will help you.

Regards,
Bernhard

yfrindel
Posts: 11
Joined: Mon Mar 02, 2015 11:50 am

Re: windev objects

Post by yfrindel » Thu Mar 19, 2015 10:51 am

ok thx, but what is the correct syntax please ?

i tried List<Ranorex.RawText> lr = @"/form[@title='Ranorex test']/list[@instance='0']/rawtext"; but it doesn't work...

i tried also this :
IList<Ranorex.RawText> RawTextL = Host.Local.Find<Ranorex.RawText>("/form[@title='Ranorex test']/list[@instance='0']/rawtext",500);
foreach (Ranorex.RawText rt in RawTextL)
{
Report.Log(ReportLevel.Info,rt.RawTextValue);
}
but the IList is empty

In ranorex spy it seems to be good (like in the snapshot)

help...
You do not have the required permissions to view the files attached to this post.

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

Re: windev objects

Post by Support Team » Fri Mar 20, 2015 5:16 pm

Hi yfrindel,

Please try the following code.
RawText lastRow = 
@"/form[@title='Ranorex test']/list[@instance='0']/rawtext[@row~'^*'][-1]";
int rowCount = lastRow.Row;
Report.Info("Row Count: " + rowCount.ToString());
This should give you exactly the row count

Regards,
Bernhard

yfrindel
Posts: 11
Joined: Mon Mar 02, 2015 11:50 am

Re: windev objects

Post by yfrindel » Mon Mar 23, 2015 3:20 pm

Thx for your help but, unfortunatly, the license has expired today.
Is it possible to have 30 more days for evaluating your software please ?

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

Re: windev objects

Post by Support Team » Tue Mar 24, 2015 3:31 pm

Hi yfrindel,

Please contact our sales team ([email protected]) if you need more time in order to evaluate Ranorex.

Regards,
Bernhard

yfrindel
Posts: 11
Joined: Mon Mar 02, 2015 11:50 am

Re: windev objects

Post by yfrindel » Fri Apr 17, 2015 1:05 pm

Hi how are you? ^^
I have a small problem with the object of type "listbox".
When I record a test scenario, Ranorex stores the double-click mouse position in the listbox. But when the elements change in this listbox (by adding a new value in the top of the list, for example), mouse double-click does not occur on the correct item when i played the scenario.
In the application I had sent you, the listbox object appears at the top right of the window. I loaded it with 4 values.
How (with the Actions window of ranorex or through code) to define an action on one of these, and be sure therefore that there will always be that on which the action (focus, click, double click .. .) will be executed ? (eg stupidly click on "element3").

thank you in advance,

Yannick

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

Re: windev objects

Post by Support Team » Mon Apr 20, 2015 12:35 pm

Hi Yannick,

I would suggest to use the invoke action "Select()". Simply drag&drop your list item to the action table and choose "Invoke Action -> Select()".
InvokeActionSelect.png
Regards,
Robert
You do not have the required permissions to view the files attached to this post.