Hi,
I wanted to automate a hybrid application and I can’t inspect or interact with this type of application.
Anyone has had this problem ? We have encountered this problem on several implementation.
Is there a method to switch context (Switch “web view” to “native_APP”, as we have with Appium) ?
Thank you,
Anthony M.
Below, different results obtained :
tree
[[object CalabashRootView] > PhoneWindow$DecorView]
[LinearLayout]
[FrameLayout] id: "content"
[XWalkCordovaView] id: "NoResourceEntry-100"
[dom]
[dom]
[dom]
[dom]
[dom]
[dom]
[dom]
[dom]
[dom]
[dom]
[dom]
[View] id: "statusBarBackground"app.Query(c => c.WebView().Css("")
Query for WebView().Css("") gave 0 results. [ ]app.Query( c => c.All(""))
Query for All("") gave 11 results.
[
[0] {
Id => null,
Description => "com.android.internal.policy.impl.PhoneWindow$DecorView{1b17ff88 V.E..... R....... 0,0-480,800}",
Rect => {
Width => 480,
Height => 800,
X => 0,
Y => 0,
CenterX => 240,
CenterY => 400
},
Label => null,
Text => null,
Class => "com.android.internal.policy.impl.PhoneWindow$DecorView",
Enabled => true
},
[1] {
Id => null,
Description => "android.widget.LinearLayout{4436d21 V.E..... ........ 0,0-480,800}",
Rect => {
Width => 480,
Height => 800,
X => 0,
Y => 0,
CenterX => 240,
CenterY => 400
},
Label => null,
Text => null,
Class => "android.widget.LinearLayout",
Enabled => true
},
[2] {
Id => "action_mode_bar_stub",
Description => "android.view.ViewStub{2c7e921e G.E..... ......I. 0,0-0,0 #1020392}",
Rect => {
Width => 0,
Height => 0,
X => 0,
Y => 0,
CenterX => 0,
CenterY => 0
},
Label => null,
Text => null,
Class => "android.view.ViewStub",
Enabled => true
},
[3] {
Id => "content",
Description => "android.widget.FrameLayout{247bb546 V.E..... ........ 0,36-480,800 #1020002 android:id/content}",
Rect => {
Width => 480,
Height => 764,
X => 0,
Y => 36,
CenterX => 240,
CenterY => 418
},
Label => null,
Text => null,
Class => "android.widget.FrameLayout",
Enabled => true
},
[4] {
Id => "NoResourceEntry-100",
Description => "org.crosswalk.engine.XWalkCordovaView{340bb307 V.E..... ........ 0,0-480,764 #64}",
Rect => {
Width => 480,
Height => 764,
X => 0,
Y => 36,
CenterX => 240,
CenterY => 418
},
Label => null,
Text => null,
Class => "org.crosswalk.engine.XWalkCordovaView",
Enabled => true
},
[5] {
Id => null,
Description => "org.xwalk.core.internal.XWalkViewBridge{2da9e1e8 V.E..... ........ 0,0-480,764}",
Rect => {
Width => 480,
Height => 764,
X => 0,
Y => 36,
CenterX => 240,
CenterY => 418
},
Label => null,
Text => null,
Class => "org.xwalk.core.internal.XWalkViewBridge",
Enabled => true
},
[6] {
Id => null,
Description => "org.xwalk.core.internal.XWalkContent{159a1001 V.E..... ........ 0,0-480,764}",
Rect => {
Width => 480,
Height => 764,
X => 0,
Y => 36,
CenterX => 240,
CenterY => 418
},
Label => null,
Text => null,
Class => "org.xwalk.core.internal.XWalkContent",
Enabled => true
},
[7] {
Id => null,
Description => "org.xwalk.core.internal.XWalkContent$1{53f4ea6 V.E..... ........ 0,0-480,764}",
Rect => {
Width => 480,
Height => 764,
X => 0,
Y => 36,
CenterX => 240,
CenterY => 418
},
Label => null,
Text => null,
Class => "org.xwalk.core.internal.XWalkContent$1",
Enabled => true
},
[8] {
Id => null,
Description => "android.view.SurfaceView{4f40e7 V.E..... ........ 0,0-480,764}",
Rect => {
Width => 480,
Height => 764,
X => 0,
Y => 36,
CenterX => 240,
CenterY => 418
},
Label => null,
Text => null,
Class => "android.view.SurfaceView",
Enabled => true
},
[9] {
Id => null,
Description => "org.xwalk.core.internal.XWalkContentView{212f3494 VFE...C. .F...... 0,0-480,764}",
Rect => {
Width => 480,
Height => 764,
X => 0,
Y => 36,
CenterX => 240,
CenterY => 418
},
Label => null,
Text => null,
Class => "org.xwalk.core.internal.XWalkContentView",
Enabled => true
},
[10] {
Id => "statusBarBackground",
Description => "android.view.View{dc94f2b V.ED.... ........ 0,0-480,36 #102002f android:id/statusBarBackground}",
Rect => {
Width => 480,
Height => 36,
X => 0,
Y => 0,
CenterX => 240,
CenterY => 18
},
Label => null,
Text => null,
Class => "android.view.View",
Enabled => true
}
]
In order to test Crosswalk views, you must specify exactly which webview you want to target.
e.g.app.query(c => c.Class("XWalkCordovaView").Css("*"));
Answers
@AnthonyMehallel
Does this help?
app.Query(c=>c.Css("*"))
or
app.Query( c=>c.WebView().Css("*"))
Hi @Glenn.Wilson ,
it does not work
tree
[[object CalabashRootView]]
[PhoneWindow$DecorView > LinearLayout]
[FrameLayout > ImageView] id: "content"
[PhoneWindow$DecorView]
[LinearLayout]
[FrameLayout] id: "content"
[XWalkCordovaView > dom] id: "NoResourceEntry-100"
[View] id: "statusBarBackground"
app.Query(c => c.Css(" * "))
Query for Css("*") gave 0 results.
[ ]
app.Query(c => c.WebView().Css(" * "))
Query for WebView().Css("*") gave 0 results.
[ ]
An other idea ?
Anthony M.
In order to test Crosswalk views, you must specify exactly which webview you want to target.
e.g.
app.query(c => c.Class("XWalkCordovaView").Css("*"));
Hi @TobiasRoikjer ,
It works !! Thank you
Anthony M.
@AnthonyMehallel you might find https://github.com/paulpatarinski/Cordova-Calabash-iOS-Plugin useful when testing Hybrid apps on iOS