Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to create driver with locale specific desired capabilities from scenario/test. #809

Open
jitesh-badgujar opened this issue Dec 23, 2020 · 6 comments

Comments

@jitesh-badgujar
Copy link

I have few tests which needs to be executed on different language and locale combinations.

But before the test starts, the driver is already initialised with capabilities from caps/capabilities.json.

Is there any way how I can get AppiumDriverManager.getDriver() during my test execution with desired capabilities object/json provided by given/current test/scenario?

This works if I provide language/locale capabilities in caps/capabilities.json file but applicable for all tests and not to the specific test.

I also tried to update the content of caps/capabilities.json during scenario execution but it get reflected in next test execution and not during the current test/driver instance.

Please suggest/help on how to achieve this. Thanks in advance!

@jitesh-badgujar
Copy link
Author

FYI: @saikrishna321

@priyankshah217
Copy link
Contributor

@saikrishna321 @SrinivasanTarget so basically in cucumber example table, we need to provide locale language and based on that it should set capability. But Problem lies here is it initialise driver before it.

@SrinivasanTarget
Copy link
Member

@priyankshah217 @jitesh-badgujar Quick solution that I could think of is adding a java annotation called @DesiredCapabilities and tag the appropriate test, ATD will pick the capabilities and apply it for that driver instance for that specific test.

@saikrishna321
Copy link
Member

@SrinivasanTarget Annotations will work on TestNG how about cucumber?

@SrinivasanTarget
Copy link
Member

@SrinivasanTarget Annotations will work on TestNG how about cucumber?

Wont listener's in cucumber don't give any information about test method? Let's check if they provide some way to hook in.

@saikrishna321
Copy link
Member

@priyankshah217 @jitesh-badgujar This can be solved by creating a appium plugin that can override the createSession. This is only supported in Appium v2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants