This question is locked. New answers and comments are not allowed.
I have one test that was used to record many actions and elements in a silverlight application using TS/VS2012. This was the very first test I ever recorded and is no longer needed/fits into the evolution of our test suite. I want to either delete, move or rename the test to clean up our project, but doing so breaks many coded references to the elements that were recorded as part of that test.
- If I delete the test, all the elements recorded in that particular test are deleted as well, which breaks any coded references to the elements that were recorded in that same test.
- If I move the test to another folder, all of the coded references to the recorded elements are broken and the below error is triggered.
- If I rename the folder containing the tests to something else, all of the coded references to the recorded elements are broken and the below error is triggered.
Error:
'TestProject.Pages.TestPage.SilverlightAppElement' does not contain a definition for 'LoginButton' and no extension method 'LoginButton' accepting a first argument of type 'TestProject.Pages.TestPage.SilverlightAppElement' could be found (are you missing a using directive or an assembly reference?)
For example, the above error is triggered when the below line of code is used in a coded step of another test, OR when used in common/utility class, and the original test is moved, deleted or renamed:
Pages.TestPage.SilverlightApp.LoginButton.User.Click();
Is there any way to move/rename or delete the original test without breaking the link between coded steps and the original elements?
Steps to reproduce:
1. Create a new project using VS
2. Record a simple test of navigating to google and typing "test", name it Test1
3. Create another test, add a basic coded step to click search (Pages.Google.Search.User.Click()), name it Test2
4. Rename Test1 to xTest1
5. Rebuild the project and note the error that is displayed
- If I delete the test, all the elements recorded in that particular test are deleted as well, which breaks any coded references to the elements that were recorded in that same test.
- If I move the test to another folder, all of the coded references to the recorded elements are broken and the below error is triggered.
- If I rename the folder containing the tests to something else, all of the coded references to the recorded elements are broken and the below error is triggered.
Error:
'TestProject.Pages.TestPage.SilverlightAppElement' does not contain a definition for 'LoginButton' and no extension method 'LoginButton' accepting a first argument of type 'TestProject.Pages.TestPage.SilverlightAppElement' could be found (are you missing a using directive or an assembly reference?)
For example, the above error is triggered when the below line of code is used in a coded step of another test, OR when used in common/utility class, and the original test is moved, deleted or renamed:
Pages.TestPage.SilverlightApp.LoginButton.User.Click();
Is there any way to move/rename or delete the original test without breaking the link between coded steps and the original elements?
Steps to reproduce:
1. Create a new project using VS
2. Record a simple test of navigating to google and typing "test", name it Test1
3. Create another test, add a basic coded step to click search (Pages.Google.Search.User.Click()), name it Test2
4. Rename Test1 to xTest1
5. Rebuild the project and note the error that is displayed