Comments (12)
@Mygod getContext()
will return your current context.
from appium-uiautomator2-server.
I meant the webview I found using findElements.
from appium-uiautomator2-server.
@Mygod Can you please more elaborate.
from appium-uiautomator2-server.
Okay.
for (WebElement element : driver.findElementsByTagName("android.webkit.WebView"))
if (someRules(element)) {
String handle = /* element.getWindowHandle()? */;
driver.context("WEBVIEW_" + getPackageName());
driver.switchTo().window(handle);
System.out.println(driver.getCurrentUrl());
}
I can also get all the window handles by calling driver.getWindowHandles()
but is it possible to know which WebView uses which handle?
from appium-uiautomator2-server.
...did you get what I meant?
from appium-uiautomator2-server.
Typically getCurrentUrl()
proxies the request to chromedriver. There is nothing specific about uiautomator2-server. From my understanding Hybrid views doesn't contain/expose the urls.
from appium-uiautomator2-server.
from appium-uiautomator2-server.
I believe you don't have url exposed to retrieve them. From my understanding if you hit getCurrentUrl()
on webview you will html content of the webview.
from appium-uiautomator2-server.
How do I getCurrentUrl
on webview?
from appium-uiautomator2-server.
@Mygod there is nothing specific to do with UiAutomator2 about handling in webview contexts. I don't have much idea on this, please raise in appropriate repo if you feel it is a valid.
from appium-uiautomator2-server.
Okay thanks!
from appium-uiautomator2-server.
Okay I opened an issue at appium but nobody seems to respond there. 😢
from appium-uiautomator2-server.
Related Issues (20)
- Can't detect elements that have deep depth HOT 2
- Appium reports "InvalidArgumentException: Exception while reading JSON" instead of a real error HOT 6
- Cannot click an element HOT 1
- Can't find AUT apk and unable to execute test HOT 1
- [bug]screencap cammand got black image in folded phone's small screen like "Oppo find N". Add a parameter to make it compatible.
- Attempt to invoke virtual method 'void android.view.accessibility.AccessibilityWindowInfo.getBoundsInScreen(android.graphics.Rect)' on a null object reference HOT 1
- UiAutomator2 driver is unable to detect web elements in webview after updates in web app HOT 4
- Is there any potentail risk that I change [waitForIdleTimeout] config to small value? HOT 2
- Unable to send text to edit text element by accessibility ID from Jetpack compose HOT 1
- Consider providing an interface to set the uiautomator2-server to automatically dismiss the dialog?
- Cannot get method getInstance from class androidx.test.uiautomator.Gestures with parameter types [class androidx.test.uiautomator.UiDevice] HOT 2
- screenshot failed in real android device HOT 2
- Find element command extremely slow in v4.21.1 HOT 6
- uninstall io.appium.uiautomator2.server/test Failed HOT 6
- The 'duration' argument of 'performActions' API does not affect on Android WebView ( Appium 1.22.*, Appium 2.5.1 ) HOT 2
- Problem parsing multi-line UiAutomator code. InvalidSelectorException: Could not parse selector expression: UiScrollable has no suitable constructor with arguments HOT 2
- how i can give same signature matching HOT 1
- My build got failed. HOT 1
- 当我使用无线调试的时候,请求速度特别慢 HOT 1
- Accessing the hiddent field was denied at android SDK level > 30 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appium-uiautomator2-server.