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

Problem updating/deleted records that use an internal key

1 Answer 83 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Barbara
Top achievements
Rank 1
Barbara asked on 29 Dec 2010, 10:48 PM
I'm new to automated testing and am writing a simple smoke test to add a record, update that record and then delete that record.  The problem is that to update the record or delete the record, the application uses the record's internal key and each time I run the ADD test a new internal key is generated so the UPDATE and DELETE tests fail as they reference the internal key of the record that was added when the test was recorded.  The record to be updated or deleted is in devexpress grid.  The test searches for the record via its external name. To update, I click on a link in the grid to open a pop-up to Edit the selected record.  To delete, I click on a button in the grid which brings up a pop-up to choose a specific delete option. The URLs for the pop-up contain the internal key so the connect to pop-up steps are failing.

I have access to the internal key in the UI once the record is created.  Is there anyway to read that value during the test and pass it to another step that needs to use it? 

1 Answer, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 31 Dec 2010, 04:56 AM
Hi Barbara,
  yes, it can be done with the Element Extraction feature.

Check out his video:
http://tv.telerik.com/watch/automated-testing-tools/using-element-extraction-variables-webui-test-studio

WebUI Test Studio also allows you to change the Find Logic which is used to locate an element in a given page. If I understand the situation you're getting Unable To Locate The Element at some point in the test. You can change the Find Logic for the problematic elements so that it doesn't rely on the "internal key". You can do it from the Elements Explorer (see screenshot 1).

Please don't hesitate to contact us again if you have more questions!

Kind regards,
Stoich
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
Tags
General Discussions
Asked by
Barbara
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Share this question
or