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
The keyword "Switch Application" #82
Comments
Could you provide some appium server log? |
Hi, @jollychang Is this server log helpful?
|
@BabauHo does this problem still exist? |
Hi, Currently, I am having a problem with "Switch Application" keyword too, but I don't know if it is the same problem or not. My code is same as the example, but it looks like the app isn't really switched, it just stay on the second app, but then the test is marked as PASS. My env: I am using a device with android 5.1.1 server log (from first app):
server log (from second app):
|
Looks like that both of your apps are running on the same device, this is not supported. I think that KW is a bit misleading (the name and the documentation), it's not really switching between applications but actually switching between appium sessions. In short: the Apps must run on different devices.
For Example: you could test WhatsApp message sending from one device to another device. However it would be a cool feature to switch between applications on the same device. This should be possible using appium but would need a completely different implementation approach where the switching just brings the started app to the foreground. |
Hi yahman72, Got it. Best regards, |
Hi everyone,
|
No, it's not possible to switch the application as mentioned "Switch Application" should actually be called "Switch Session" because it just switches between appium sessions, not between applications = it just automates the application that's on front. You could try to bring the other app to front by using "start activity" |
Thank you for your answer. Ok I see but i'm not sure to understand why it does work then ? |
what do you mean by "it works"? |
i mean that i was able to launch chrome with switch application and to enter the correct password in the corresponding field. I know it has worked because the mobile was connected to the wifi. |
oh? - I don't think it should work at all, but appium behaves a bit oddly with the "start activity". Did you try also without the "switch application"? in this case it does nothing (i.e. it should also work without it). If you really want to see the chrome then do it like this
|
You're absolutely right it works also without Switch application. |
Hi
I use the keyword "Switch Application" and follow the example:
${appium1}= Open Application http://localhost:4723/wd/hub alias=MyApp1 platformName=Android platformVersion=6.0 deviceName='' app=C:/XXXX/app1.apk
${appium2}= Open Application http://localhost:4725/wd/hub alias=MyApp2 platformName=Android platformVersion=6.0 deviceName='' app=C:/XXXX/app2.apk
Capture Page Screenshot Checkit0.jpg
Switch Application ${appium1}
Capture Page Screenshot Checkit1.jpg
Sleep 3s
After execute "Switch Application" and execute "Capture Page Screenshot".
The log return
" Keyword 'Capture Page Screenshot' could not be run on failure: KeyError: 'error' "
What's wrong with my usage?
I'll appreciate any help!
Thanks!
The text was updated successfully, but these errors were encountered: