This is a migrated thread and some comments may be shown as answers.

Replace all element ID's

10 Answers 36 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Reinout
Top achievements
Rank 2
Reinout asked on 13 Jan 2014, 01:00 PM
Dear Telerik,

We use a runtime-keymapper between our application and the front end. Until now ID's are generated in this format: Entityname.Attributename (like car.door). Unfortunately, we are using a new styling method, which relies on jQuery, which does not like the dot in the ID's.

Are there easy ways to rename all ID's within my script or project, to replace the dot with a different character? In other words, were is the information stored about all the element ID's?

Thanks in advance.

10 Answers, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 14 Jan 2014, 12:00 PM
Hi Reinout,

You have assigned this ticket for Telerik Testing Framework, but given the problem that you are describing, I believe you are not referring test automation issue.

Let me know if I am missing something. Do you want to replace all ID's within some test project? 

Hope to hear from you soon.

Regards,
Boyan Boev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Reinout
Top achievements
Rank 2
answered on 14 Jan 2014, 12:43 PM
Dear Boyan,

Thanks for the reply and sorry that my problem is not clear!

I would like to replace all the ID's within my test project.

The way Telerik finds my elements for the test steps is for instance:

- ID is exactly "Car.Door"

but what I want:

- ID is exactly "CarDoor"

I know how I could manually do this, but that is a lot of work.
Is there a way to rename all these find fields within my Telerik test, without re-recording my steps or changing every individual item?

Maybe it is stored somewhere in a projectfile, where we could create some kind of find&replace function.

I am curious to your ideas about this problem.

Thanks!
Reinout
0
Reinout
Top achievements
Rank 2
answered on 15 Jan 2014, 09:19 AM
With some research I found that the Element Repository is build up by all the *.tstest files.

The way the find logic for ID is represented here as: {"Clause":"id=Werksituatie1.InkomenSoort"}.

If I would change all these clauses to {"Clause":"id=Werksituatie1_InkomenSoort"}, would this solve my problem? Or are there other places where I have to change something?
0
Accepted
Boyan Boev
Telerik team
answered on 16 Jan 2014, 03:53 PM
Hi Reinout,

Yes, you are right the find logic of the elements is stored in the xml of test (*.tstest). If you have a coded step it is also stored in Pages.g.cs (it is generated every time when you run the test).

Here is an article about Element Repository.

Yes, this should resolve your problem if you replace the IDs in the *.tstest. When you run the test Pages.g.cs will be generated again with the new IDs.

Before you perform the change I recommend you to create a back up copy of all your tests.

Let me know if this helps. 

Regards,
Boyan Boev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Reinout
Top achievements
Rank 2
answered on 17 Jan 2014, 06:42 AM
Hi Boyan,

Thank you for the confirmation.
I already tried this with a newly created project and it works fine!

Best,
Reinout
0
Boyan Boev
Telerik team
answered on 17 Jan 2014, 07:45 AM
Hi Reinout,

I am glad to hear that.

If you need further assistance, please contact us again.

Regards,
Boyan Boev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Reinout
Top achievements
Rank 2
answered on 27 Jan 2014, 12:43 PM
Today we changed all the ID's in the *.tstest files.

It is working correctly locally, the pages.g.cs file is generated with the correct find logic, also for coded steps.
But, when remotely executing, the pages.g.cs file is generated with correct find logic for normal steps, but still has the old find logic of coded steps.

How is this possible? And how can we override this? Is the find logic from coded steps cached somewhere on a remote server?
0
Boyan Boev
Telerik team
answered on 30 Jan 2014, 09:13 AM
Hello Reinout,

This is was a bug in the test list execution, that we already fixed in our latest official release.

Please go ahead and install it (1327 version).

Let me know if this helps.

Regards,
Boyan Boev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Reinout
Top achievements
Rank 2
answered on 30 Jan 2014, 09:39 AM
Hi Boyan,

Thanks for the reply, I already submitted a ticket and got the answer yesterday and this update does the job!

Thanks.
0
Boyan Boev
Telerik team
answered on 30 Jan 2014, 10:52 AM
Hi Reinout,

Glad to hear that!

If you need further help, please do not hesitate to contact us again.

Regards,
Boyan Boev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Reinout
Top achievements
Rank 2
Answers by
Boyan Boev
Telerik team
Reinout
Top achievements
Rank 2
Share this question
or