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

Run test created with VS plugin with resource file (.resx) in Test Studio

5 Answers 414 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Davide
Top achievements
Rank 1
Davide asked on 10 Jul 2015, 03:42 PM

Hi all,
I'm creating a list of tests for a web application, and I'm using a Resource file (.resx) to localize different strings, so that I can run them for different languages.
It works fine when I launch the tests in Visual Studio, but it doesn't find a reference to the .resx file when i load the project with Test Studio.
What do i have to do to resolve this issue?

Thank for the support.

Davide

5 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 10 Jul 2015, 09:11 PM
Hi Davide,

I'd like to see exactly how you're trying to use this .resx file in your Test Studio tests. Can you send me a sample Test Studio project that demonstrates this issue? Just put the folder into a .zip file and attach that file.

Regards,
Cody
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Davide
Top achievements
Rank 1
answered on 13 Jul 2015, 08:19 AM

Hi Cody,

thanks for the support, here a simple demo with resx file

I have another question
In VS, if I launch multiple (indipendent) tests using the VS's Test Explorer, sometimes some tests fail without a reason. An example, it's not recognized that an element is not visibile anymore, but if I launch the test alone it works well.

It's a problem of VS?

Using Telerik tools this doesn't appen.

 

Thank again

Davide

0
Cody
Telerik team
answered on 13 Jul 2015, 08:14 PM
Hi Davide,

Thank you for the sample project. I was able to reproduce the problem and now I fully understand what exactly is going on. First please pay close attention to the reported error:

System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "TestStudioProject.Resource.resources" was correctly embedded or linked into assembly "TestStudioProject" at compile time, or that all the satellite assemblies required are loadable and fully signed.

The .resx file is actually another type of source code file. You can have more than one of them in a project. Just like your .cs files they get compiled into binary code as a .resources file. At run time the static Resource class searches the .resources file for the specified resource in order to use it.

Unfortunately the Test Studio IDE does not understand .resx files. As a result it does not compile them to generate a .resources file for the test to use. As a result at runtime the static Resources file cannot find the specified resources.

As an alternative I recommend you use either:

1) A data driven test. This is probably the easier approach to what you're trying to achieve.
2) An app.config file, the content of which can be set via Visual Studio settings as shown in the attached screen shot. We also have this article how to correctly use the app.config file.

"In VS, if I launch multiple (indipendent) tests using the VS's Test Explorer, sometimes some tests fail without a reason."

I have no explanation for this. I would like to track this as a separate problem in a separate ticket so it doesn't get mixed up with the .resx issue. Please start a new support ticket or forum thread on this new problem. In there please attach the test log showing the failure. We'll start diagnosing the problem based on what the log shows us.


Regards,
Cody
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Davide
Top achievements
Rank 1
answered on 15 Jul 2015, 08:01 AM

Hi Cody,

I used a settings file, because it is similar to the resx one, and it works good.

For the other question I saw better what is the problem and i'll open a new ticket.

 

Thanks for the support.

Davide

I created a .settings file, because it has a structure similar to the resx one, and it works good :)
I created a .settings file, because it has a structure similar to the resx one, and it works good :)
I created a .settings file, because it has a structure similar to the resx one, and it works good :)
0
Cody
Telerik team
answered on 17 Jul 2015, 02:52 AM
Hello Davide,

Wonderful! I'm glad I could help.


Regards,
Cody
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Davide
Top achievements
Rank 1
Answers by
Cody
Telerik team
Davide
Top achievements
Rank 1
Share this question
or