Using the resource folder in a test project for test line data

I wanted to use the resource folder in my test project with Android Studio to store internationalized strings that I will only use in my user interface tests.

But since I can create a folder /app/src/androidTest/res , I cannot create a resource folder, such as the "values" in it.

Android Studio says that this folder already exists. It exists, but in my main project under /app/src/main/res.

So, can I create resources that are available only for my test project, and how, or am I completely wrong, and the reason I cannot do this is because I should not do this?

Thanks.

+5
source share
2 answers

As already mentioned in this, you are probably using the wrong package in the import statement.

 import com.your.package.test.R; 
+8
source

You can create resources under /app/src/debug/res and use them

+1
source

Source: https://habr.com/ru/post/1207726/


All Articles