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

Converting Application Under Test to .NET 4: Tips for Maintaining Tests?

9 Answers 163 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 2
Jason asked on 07 Jan 2011, 12:00 AM
One of my applications under test is currently being converted to .NET 4 from .NET 1.1 (yes, I know, it's about time).  The most meaningful consequence of this from my standpoint is that the names of the HTML elements referenced by my tests are all going to change because, unlike now, they'll all be inherited from master pages. For instance, a control named "FaceAmountDDLSelect" will become "ContentPlaceHolder1PageHoldAccordionOptionalFilterViewUCOptionFilterControlsUCFaceAmountDDLSelect".  Or something like that.

In order to maintain the usability of my tests post-conversion, I'm definitely in search of advice.  It seems to me that it might be as simple as changing the find logic to "contains" for each control since the legacy control names won't be deleted entirely, but only appended.  Regardless, I'd be interested to hear from anyone who has dealt with a similar situation.  Thank you!

9 Answers, 1 is accepted

Sort by
0
Accepted
Cody
Telerik team
answered on 11 Jan 2011, 07:59 PM
Hello Jason,

I think you are on the right track. We haven't had someone upgrade the .NET version of the web application like this before, and so can't really offer any solid advice. If you'll write up a report about your experience and submit it to us, sort of like a blog post "here's the problem and here's what I did to solve it" type of write up. If we may use it in one of our KB articles I can award you quite a few Telerik Points for this.

All the best,
Cody
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Jason
Top achievements
Rank 2
answered on 12 Jan 2011, 09:08 PM
Cody,

Thanks for the response!  I'm in the process of making the changes to my find logic for each project that covers the app in question, and if this succeeds, I'll definitely write something up for community edification.

One question while I'm in the trenches though:  is there a way to change the find logic globally for a project (other than the priority-level changes found in the project settings)?  What I find myself doing right now is going to each element in the DOM explorer and changing each "id exact" to an "id contains".  While it's nice that this need only be done per project and not per test, it's still rather cumbersome.  It'd be nice if there was a way in the QA edition to persist the change to the whole project at once.  If there is a way and I'm just missing it, I'd appreciate being set straight.  Otherwise, it might turn into a feature request. :)
0
Keaegan
Telerik team
answered on 13 Jan 2011, 01:00 AM
Hi Jason,

Sorry for interjecting here. When you are making these changes, you could also do the following:

  • Still change items from "ID Exact" to "ID Contains"
  • After doing so, change a character in the next field (if it reads FaceAmountDDLSelect, make it FaceAmountDDLSelect1 or something else identifiable)
  • Click okay
Doing this, you should be prompted to change ALL instances of the element within the project. This will change it to the wrong find logic. But, the inverse will also be true. Repeat the above process (you can leave "Contains"), only this time, delete the incorrect character you added previously. When you click okay again, you will again be prompted to update all instances of the element. Do so again and it should be a process you can use for updating the element all at once (each reference to it).

This should save you some time in your transition. If you only change the field you mention, you won't see the additional screen (shown in attached image). Please let me know if you have difficulty running through this process.

Best wishes,
Keaegan
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Jason
Top achievements
Rank 2
answered on 13 Jan 2011, 01:25 AM
Keagan,

Since I'm having a hard time following your logic, let me take you through how I've been doing it, then we can explore whether one method saves more time than the other.

1.) First, I right-click an element and select Edit, then change the find logic for id to "Contains" from "Exact".

2.) I get a window showing me every test, and every step within each test, that would be affected by the change.  I check "all" and click OK, persisting the change to all affected test steps in the project.

So it seems to me like I'm already able to persist my change to all references to a given element. I'm not seeing how adding a character at the end of the id only to delete it and persist the changes later fundamentally changes the task at hand - in fact it seems to add a step or two.  Either way, I'm faced with the task of making this change for every single element in the project.  For some projects, that won't be so daunting, but for some, it's a pretty tall order.  

What I was getting at with my last post is that it would be optimal if there was some way to either change all find logic for the id of all elements to "Contains", or at the very least, make it so that it records as "Contains" by default (had I been able to do that from the get-go, I wouldn't have this problem to begin with, it seems).
0
Keaegan
Telerik team
answered on 13 Jan 2011, 06:41 PM
Hi Jason,

I apologize for my confusion: I thought you weren't getting the box to "update all" versions of the element. From this further description I can see that you are asking for a new feature: The ability to update "All Pages" references to elements at once (such as when changing servers for the site/application).

This type of feature would most likely only be used only when you are moving the actual application/website from the development server to another server (whether live or another development server) so that all of the references can be updated to still locate the same item. So long as something regarding the element remains static (name or ID, whatever is being used to find the element) this should be something that could be implemented. Does this more aptly describe the type of feature you are looking for?

I have also included a screenshot for my idea on where this type of feature would be located (though, if implemented this may change to a different locale), do you feel that a different spot in the test would be preferable (Such as the Project > Show Settings menu)? Would you expect more of a feature-set than changing all instances of "Exact" in the project to "Contains"?

Please let me know if there is anything else you would expect this tool to do and I will log the feature request for us. Thank you in advance for your patience while we were taking a look at this inquiry.

Kind regards,
Keaegan
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Jason
Top achievements
Rank 2
answered on 13 Jan 2011, 07:27 PM
Keagan,

I think that's exactly what I was getting at - thank you!  The location of the feature seems to me to make the most sense as you proposed - in the properties menu for All Pages.

I can't think of a need for anything beyond the ability to change all instances of "exact" to "contains" for a given project - this ability by itself would, I think, provide for relatively painless maintenance of existing tests for situations like a server migration or, in my case, a .NET framework conversion.

Thank you very much for your response, and for patience on your end as well!

-Jason
0
Jason
Top achievements
Rank 2
answered on 16 Feb 2011, 10:23 PM
Cody/Keagan,

I have now verified that changing the find logic for each element id from "exact" to "contains" is the solution - or at the very least, this will maintain the vast majority of steps recorded in a .NET 1.1 environment when ran against a .NET 4 environment.  The only exceptions I've found have been Peter Blum date box controls which seem to rebel against "contains" logic even in a .NET 1.1 context.  And repeaters/grids, but those were a problem pre-conversion and will be the subject of another soon-to-come forum post.

I'm definitely interested in writing up a blog post/kb article explaining the problem and solution - to whom and how should I submit it?

Thanks!

-Jason
0
Cody
Telerik team
answered on 01 Mar 2011, 10:34 PM
Hello Jason,

I apologize for the delay responding to you.

You can do two things:
- Write up the full details in a forum post, this thread is perfect
- Send it in an email to 

Kind regards,
Cody
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Cody
Telerik team
answered on 10 Mar 2011, 10:55 PM
Hello Jason,

We recieved your submission, thank you! I've granted you 2000 Telerik points for this.

Kind regards,
Cody
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
General Discussions
Asked by
Jason
Top achievements
Rank 2
Answers by
Cody
Telerik team
Jason
Top achievements
Rank 2
Keaegan
Telerik team
Share this question
or