Currently we are using Telerik test studio plugin for visual studio for record automated tests. For some verification,tests (Eg:validating tooltips) we need access objects generated by the Telerik. Generally this works fine. However sometimes namespaces of these objects automatically changed and it cause the failure of tests. Is there any better way to handle this situation?
Best Regards,
Suranga Bandara
11 Answers, 1 is accepted
At no time should the namespace for the Pages class change on its own. The only way for it to change is if you change the Namespace setting in the project settings dialog as shown in the attached screen shot.
Can you show me an example where you believe the namespace was changed? I'd like to investigate further what's going on and what may be causing this symptom.
Regards,
Cody
Telerik
Test Studio Trainings
Thanks for the reply really sorry about late replay. The thing happend to us is set of out objects was in namespace like this
Pages.xxx.xxx.SilverlightApp . However after some time it seems to be all thoese objects are in Pages.xxx.xxx.SilverlightApp0. There seems to be no way to move them back to original namespaces as well. During some test we were accessing those objects directly in code behind to do some manipulations. If you have any clue why it is happened or are there any good practices to follow . It will be really great.
Thanks
Suranga
Thank you for the clarification. That's actually not a namespace that is changing. It is the class name contained in our automatically generated Pages class, which is stored in the automatically generated Pages.g.cs/vb file. We have this KB article dedicated to explaining how to overcome this problem.
Let me know if you need further assistance with this.
Regards,
Cody
Telerik
Test Studio Trainings
Thanks for the information. I am using telerik visual studio plugin for test automation. So I am not sure where I can change recording options. So I changed compare mode in Object repository to FullPath. But it seems to be not working fine yet for me. Now I have following issue.
When I record test I can see element is available . I am able to access it in code behind and suggestions available. When I build the project compilation error occurred that element is not available. Seems to be something happening during compilation time.
Best Regards,
Suranga
In Visual Studio you click on the Project Settings icon located in our toolbar, as shown on this page.
When I build the project compilation error occurred that element is not available.
That sounds like the element got merge with another element having a different name. If you want to send me a copy of your project having a compile error, I'll be glad to take a look and assist with fixing the problem.
Regards,
Cody
Telerik
Test Studio Trainings
Thanks for the quick reply. It is difficult to send the project to you due to it contains company related information and it needs our product deployment to work. Currently I don't have sample application to reproduce this issue.
However I have dig down this issue bit more.
I have record some steps. It added some elements to project and I can see them in Element Explorer. And entry is added to Pages.cs file .
When I building that application newly added elements disappearing from Pages.cs file. When I open test again , elements are again added to Pages.cs file. I am wondering what could be reason for this issue.
Best regards,
Suranga
Our end user license agreement includes a non-disclosure clause, meaning you're already covered for "company related information". We are all bound to this non-disclosure agreement.
Second, I don't need to be able to run your test project. I'm only looking at what it takes to properly merge your duplicate elements together and allow the project to compile. My work is done once I achieve that.
When I building that application newly added elements disappearing from Pages.cs file. When I open test again , elements are again added to Pages.cs file. I am wondering what could be reason for this issue.
Until I have a copy of your project in hand so that I can witness this happening, I have no idea.
P.S. I just realized this is a public forum. I am sending you an email invitation to a private dropbox folder only you and I have access to.
Regards,
Cody
Telerik
Test Studio Trainings
Hi Cody,
Can I change the Assembly Name and/or Namespace name in the project's Properties without causing problems?
thx,
dan
Please note that the forum post you point to is quite older and it would be better if you submit a new entry sharing your details and exact scenario.
Anyways, what you mean by changing an assembly name? From the Project settings you could add/remove assemblies but not rename them. Please elaborate more. Changing the Namespace shouldn't be causing an issue. Though further details will be appreciated.
Regards,
Elena Tsvetkova
Telerik by Progress
Test Studio Trainings
Hi Elena,
I was referring to the editable fields in the Settings panel. (please see attached screenshot)
Here's why I asked this question...
All my cs files have a namespace of 'TestProject2'. My project is named TestProject3. This is not a problem, in itself, but if I wanted to change the namespace, how do I do that? If I simply change the namespace declaration in my cs files to TestProject3, I get an error ...
f:\New folder\Test Studio Projects\TestProject3\Accounts\Script Components\Log Account ID and Owner Name.tstest.cs(26,17) : error CS0246: The type or namespace name 'Pages' could not be found (are you missing a using directive or an assembly reference?)
So, how can I change the namespace so it compiles?
Many Thanks,
dan
Renaming the Assembly name does not affect the compilation of the project in any way. Though while testing renaming the Namespace I found inconsistent behavior. It is described into this feedback entry where you could follow its progress as well, vote for the issue, etc.
Meanwhile you could use the workaround described in the feedback as well - either keep the code behind files open in the Test Studio UI while renaming the namespace or manually make them dirty to be saved with the changes.
I hope you will manage to accomplish your requirements until the inconsistent behavior is fixed by the development team.
Regards,
Elena Tsvetkova
Telerik by Progress
Test Studio Trainings