How to update element

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
marcob
Posts: 2
Joined: Mon Jul 02, 2012 9:51 am

How to update element

Post by marcob » Mon Jul 02, 2012 12:46 pm

Hi,

during runtime of a test I get a text element by using the RxPath (I've got from Spy). On this element I perform a edit action then I want to read out the new value of the element (property Text). When I do this on the same object I will always read out the old value before modification.

As a workaround I call Host.Local.TryFindSingle one more time, store the result in the object and check the values. This I have to do several times (editing and checking outer and inner boundaries).

Could you please help me and tell me if there is any possibility to update the object I have stored instead of calling TryFindSingle again?

Thank you very much for your help in advance.

Best regards
Marco

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to update element

Post by Support Team » Tue Jul 03, 2012 1:02 pm

Hi,

Could it be that your element just takes some time to update the data?
What happens if you add a short delay before you read the changed value?
Please also check if the valid property is set to false after the text changed?
I am asking because it could be that a new element is created and therefore Ranorex doesn't get the new value because the old element still holds the old value.
Which technologies are used by your application and about what kind of application we are talking about?

Regards,
Markus
Ranorex Support Team
.
Image

marcob
Posts: 2
Joined: Mon Jul 02, 2012 9:51 am

Re: How to update element

Post by marcob » Tue Jul 03, 2012 5:14 pm

Hi,

Thanks for your answer.

I am using the .NET Framework 4.0.
We develop the test scripts and use Ranorex in Visual Studio 2010.
The application under test is also developed in C#.

I have checked the valid property of our text fields. The property is always set to 'true'.
In my case I think it is a timing issue like you described. I changed back the software so it uses always the same Ranorex.Text I have created with the TryFindSingle-method. Sometimes the script fails.

When I use a method or a property of a Ranorex.Adapter type does Ranorex always return the current visible value in a GUI? So could I store objects (loaded with TryFindSingle) and use the same object for a whole test run?

Regards,
Marco

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to update element

Post by Support Team » Wed Jul 04, 2012 12:05 pm

Hi,

You're welcome!
The answer, concerning your question if you can use the same object for the whole test, is yes.
If you have created a Ranorex adapter from a live element you can use it for the whole test as Ranorex always fetches the actual values, which Ranorex is getting via different technologies.
It can happen that the GUI shows different values than Ranorex, if that happen there are two reasons for it, it could be that a new element was created or that the value was not properly set, that means that Ranorex gets the wrong values from the accessibility interface of your application.

Regards,
Markus
Ranorex Support Team
.
Image