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

Wait until wifi is connected #12502

Closed
zuzeac opened this issue Apr 15, 2019 · 4 comments
Closed

Wait until wifi is connected #12502

zuzeac opened this issue Apr 15, 2019 · 4 comments
Assignees
Labels
Enhancement feature UIAutomator2 specific to uiautomator2 driver

Comments

@zuzeac
Copy link

zuzeac commented Apr 15, 2019

The problem ( More like a new feature)

Is there a method to wait until the connection state is Connected then continue with the test execution?

Environment

  • Appium version (or git revision) that exhibits the issue: 1.12.1
  • Last Appium version that did not exhibit the issue (if applicable):
  • Desktop OS/version used to run Appium: MacOS 10.14
  • Node.js version (unless using Appium.app|exe): 11.6.0
  • Npm or Yarn package manager: 6.5.0
  • Mobile platform/version under test: Android
  • Real device or emulator/simulator: real device
  • Appium CLI or Appium.app|exe:

Details

I'm turning off the wifi then I turning on again. And I need to move forward with the steps after the wifi is connected. The problem is that the steps are executed before the device is connected. It takes some second since I turn on the wifi and it connects again.
I found this command and I will try to executed based on my needs:
adb shell dumpsys wifi | grep "mNetworkInfo"
But I was thinking, maybe we can add something like this in Appium waitUntil(ExpectedCondition.etc..)

@mykola-mokhnach
Copy link
Collaborator

I think we could add such info (wifi state, and, probably, the AP name) into device_details endpoint

@mykola-mokhnach mykola-mokhnach added Android related to Android-native driver(s) Enhancement feature labels Apr 15, 2019
@mykola-mokhnach mykola-mokhnach added UIAutomator2 specific to uiautomator2 driver and removed Android related to Android-native driver(s) labels Apr 16, 2019
@mykola-mokhnach mykola-mokhnach self-assigned this Apr 16, 2019
@mykola-mokhnach
Copy link
Collaborator

Since the recent appium@beta you can use mobile: deviceInfo endpoint in UIA2 to get the information about the state of all device networks. The given endpoint should return a map whose networks key will include the list of available networks with their properties. Check https://github.com/appium/appium-uiautomator2-server/blob/master/app/src/main/java/io/appium/uiautomator2/handler/GetDeviceInfo.java, https://developer.android.com/reference/android/net/NetworkInfo and https://developer.android.com/reference/android/net/NetworkCapabilities.html for more details on the available entries.

@zuzeac
Copy link
Author

zuzeac commented Apr 17, 2019

Thank you very much :)

@lock
Copy link

lock bot commented Apr 17, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement feature UIAutomator2 specific to uiautomator2 driver
Projects
None yet
Development

No branches or pull requests

2 participants