Unable to click on check box in webview

Hi Team,

Unable to click on check box in webview


could you please help on this

Hi Team,
could you please look into this Issue totally Blocked.

Thanks

Please try to run the setContex command before you perform the click:
driver.context(“WEBVIEW_1”);

Other issue that can cause that is multiple webview in the same screen.

Hi Guy,

Thanks for your response.

When i use getContextHandles(), i am getting below contexts.

NATIVE_APP_INSTRUMENTED
WEBVIEW_2
NATIVE_APP
WEBVIEW_1
I tried each of these set contexts before clicking on my checkbox like
driver.context(“WEBVIEW_1”);
driver.findElement(By.xpath("//[@id=‘action-bar-btn-checkbox’]")).click(); //This didnt help us
//Then tried to set context with WEBVIEW_2 like below, but didn help.
driver.context(“WEBVIEW_2”);
driver.findElement(By.xpath("//
[@id=‘action-bar-btn-checkbox’]")).click();

There is no problem with the xpath or Synchronization as i could able to highlight the object.

When we tried to print the page source of the screen, we are not getting any HTML elements of the webview, all we getting is below:

02:00:41 PM	<?xml version="1.0" encoding="UTF-8"?><node onScreen="false" top="false" visible="false">
   <VNWindow alpha="1" class="VNWindow" enabled="false" height="1536" hidden="false" knownSuperClass="UIWindow" onScreen="true" tag="0" top="false" visible="true" width="2048" x="0" y="0">
      <UITransitionView alpha="1" class="UITransitionView" enabled="true" height="1536" hidden="false" onScreen="true" tag="0" top="false" visible="true" width="2048" x="0" y="0">
         <UIView alpha="1" backgroundColor="0xFFFFFF" class="UIView" enabled="false" height="1536" hidden="false" onScreen="true" tag="0" top="false" visible="true" width="2048" x="0" y="0">
            <UIWebView alpha="1" backgroundColor="0x5B6367" class="UIWebView" enabled="false" height="1536" hidden="true" knownSuperClass="UIWebView" onScreen="true" tag="0" top="false" visible="true" width="2048" x="0" y="0">
               <_UIWebViewScrollView alpha="1" class="_UIWebViewScrollView" enabled="true" height="1536" hidden="false" knownSuperClass="UIScrollView" onScreen="true" parentHidden="true" tag="0" top="false" visible="true" width="2048" x="0" y="0">
                  <UIWebBrowserView alpha="1" backgroundColor="0x5B6367" class="UIWebBrowserView" enabled="false" height="1536" hidden="false" onScreen="true" parentHidden="true" tag="0" text="" top="false" visible="true" width="2048" x="0" y="0"/>
                  <UIImageView alpha="0" class="UIImageView" enabled="false" height="4" hidden="true" knownSuperClass="UIImageView" onScreen="true" parentHidden="true" tag="0" top="false" visible="true" width="2036" x="6" y="1524"/>
                  <UIImageView alpha="0" class="UIImageView" enabled="false" height="1524" hidden="true" knownSuperClass="UIImageView" onScreen="true" parentHidden="true" tag="0" top="false" visible="true" width="4" x="2036" y="6"/>
               </_UIWebViewScrollView>
            </UIWebView>
            <WKWebView alpha="1" class="WKWebView" enabled="true" height="1536" hidden="false" onScreen="true" tag="0" top="false" visible="true" width="2048" x="0" y="0">
               <WKScrollView alpha="1" backgroundColor="0xEAEAEA" class="WKScrollView" enabled="false" height="1536" hidden="false" knownSuperClass="UIScrollView" onScreen="true" tag="0" top="false" visible="true" width="2048" x="0" y="0">
                  <WKContentView alpha="1" class="WKContentView" enabled="true" height="1536" hidden="false" onScreen="true" tag="0" top="false" visible="true" width="2048" x="0" y="0">
                     <UIView alpha="1" class="UIView" enabled="true" height="1536" hidden="false" onScreen="true" tag="0" top="false" visible="true" width="2048" x="0" y="0">
                        <UIView alpha="1" class="UIView" enabled="true" height="1536" hidden="false" onScreen="true" tag="0" top="false" visible="true" width="2048" x="0" y="0">
                           <WKCompositingView alpha="1" class="WKCompositingView" enabled="true" height="1536" hidden="false" onScreen="true" tag="0" top="false" visible="true" width="2048" x="0" y="0">
                              <WKCompositingView alpha="1" class="WKCompositingView" enabled="true" height="1536" hidden="false" onScreen="true" tag="0" top="false" visible="true" width="2048" x="0" y="0">
                                 <WKCompositingView alpha="1" backgroundColor="0xEAEAEA" class="WKCompositingView" enabled="false" height="1536" hidden="false" onScreen="true" tag="0" top="false" visible="true" width="2048" x="0" y="0">
                                    <WKCompositingView alpha="1" class="WKCompositingView" enabled="true" height="0" hidden="false" onScreen="false" tag="0" top="false" visible="false" width="0" x="0" y="0">
                                       <WKCompositingView alpha="1" class="WKCompositingView" enabled="true" height="1536" hidden="false" onScreen="true" tag="0" top="true" visible="true" width="2048" x="0" y="0"/>
                                    </WKCompositingView>
                                    <WKCompositingView alpha="1" class="WKCompositingView" enabled="true" height="0" hidden="false" onScreen="false" tag="0" top="false" visible="false" width="0" x="0" y="0"/>
                                 </WKCompositingView>
                                 <WKCompositingView alpha="1" class="WKCompositingView" enabled="true" height="0" hidden="false" onScreen="false" tag="0" top="false" visible="false" width="0" x="0" y="0"/>
                              </WKCompositingView>
                              <WKCompositingView alpha="1" class="WKCompositingView" enabled="true" height="0" hidden="false" onScreen="false" tag="0" top="false" visible="false" width="0" x="0" y="0"/>
                           </WKCompositingView>
                        </UIView>
                     </UIView>
                  </WKContentView>
                  <UIView alpha="1" class="UIView" enabled="true" height="0" hidden="false" onScreen="false" tag="0" top="false" visible="false" width="0" x="0" y="0"/>
                  <UIImageView alpha="0" class="UIImageView" enabled="false" height="1524" hidden="true" knownSuperClass="UIImageView" onScreen="true" tag="0" top="false" visible="true" width="4" x="2036" y="6"/>
                  <UIImageView alpha="0" class="UIImageView" enabled="false" height="4" hidden="true" knownSuperClass="UIImageView" onScreen="true" tag="0" top="false" visible="true" width="2036" x="6" y="1524"/>
               </WKScrollView>
            </WKWebView>
         </UIView>
      </UITransitionView>
   </VNWindow>
   <UITextEffectsWindow alpha="1" class="UITextEffectsWindow" enabled="false" height="1536" hidden="false" knownSuperClass="UIWindow" onScreen="true" tag="0" top="false" visible="true" width="2048" x="0" y="0">
      <UIInputSetContainerView alpha="1" class="UIInputSetContainerView" enabled="true" height="1536" hidden="false" onScreen="true" tag="0" top="false" visible="true" width="2048" x="0" y="0">
         <UIInputSetHostView alpha="1" class="UIInputSetHostView" enabled="true" height="0" hidden="false" onScreen="false" tag="0" top="false" visible="false" width="2048" x="0" y="1536"/>
      </UIInputSetContainerView>
   </UITextEffectsWindow>
   <UITextEffectsWindow alpha="1" class="UITextEffectsWindow" enabled="false" height="1536" hidden="false" knownSuperClass="UIWindow" onScreen="true" tag="0" top="false" visible="true" width="2048" x="0" y="0">
      <UICalloutBar alpha="0" class="UICalloutBar" enabled="true" height="0" hidden="true" onScreen="false" tag="0" top="false" visible="false" width="0" x="0" y="0">
         <UICalloutBarBackground alpha="1" class="UICalloutBarBackground" enabled="false" height="0" hidden="false" onScreen="false" parentHidden="true" tag="0" top="false" visible="false" width="0" x="0" y="0">
            <_UIBackdropEffectView alpha="1" class="_UIBackdropEffectView" enabled="false" height="0" hidden="false" onScreen="false" parentHidden="true" tag="0" top="false" visible="false" width="0" x="0" y="0"/>
            <UIView alpha="1" backgroundColor="0x050505" class="UIView" enabled="false" height="0" hidden="false" onScreen="false" parentHidden="true" tag="0" top="false" visible="false" width="0" x="0" y="0"/>
            <_UIBackdropContentView alpha="1" class="_UIBackdropContentView" enabled="true" height="0" hidden="false" onScreen="false" parentHidden="true" tag="0" top="false" visible="false" width="0" x="0" y="0">
               <UIImageView alpha="0" class="UIImageView" enabled="false" height="0" hidden="true" knownSuperClass="UIImageView" onScreen="false" parentHidden="true" tag="0" top="false" visible="false" width="0" x="0" y="0"/>
               <UIImageView alpha="0" class="UIImageView" enabled="false" height="0" hidden="true" knownSuperClass="UIImageView" onScreen="false" parentHidden="true" tag="0" top="false" visible="false" width="0" x="0" y="0"/>
               <_UIBackdropView alpha="1" class="_UIBackdropView" enabled="false" height="0" hidden="false" onScreen="false" parentHidden="true" tag="0" top="false" visible="false" width="0" x="0" y="0">
                  <_UIBackdropEffectView alpha="1" class="_UIBackdropEffectView" enabled="false" height="0" hidden="false" onScreen="false" parentHidden="true" tag="0" top="false" visible="false" width="0" x="0" y="0"/>
                  <UIView alpha="1" backgroundColor="0xFFFFFF" class="UIView" enabled="false" height="0" hidden="true" onScreen="false" parentHidden="true" tag="0" top="false" visible="false" width="0" x="0" y="0"/>
                  <_UIBackdropContentView alpha="1" class="_UIBackdropContentView" enabled="true" height="0" hidden="false" onScreen="false" parentHidden="true" tag="0" top="false" visible="false" width="0" x="0" y="0">
                     <UIImageView alpha="0" class="UIImageView" enabled="false" height="0" hidden="true" knownSuperClass="UIImageView" onScreen="false" parentHidden="true" tag="0" top="false" visible="false" width="0" x="0" y="0"/>
                  </_UIBackdropContentView>
               </_UIBackdropView>
            </_UIBackdropContentView>
         </UICalloutBarBackground>
         <UICalloutBarButton accessibilityLabel="Show previous items" alpha="1" class="UICalloutBarButton" enabled="true" height="0" hidden="true" knownSuperClass="UIButton" onScreen="false" parentHidden="true" tag="0" top="false" visible="false" width="0" x="0" y="0">
            <UIImageView alpha="1" class="UIImageView" enabled="false" height="0" hidden="false" knownSuperClass="UIImageView" onScreen="false" parentHidden="true" tag="0" top="false" visible="false" width="0" x="0" y="0"/>
            <UIButtonLabel alpha="1" class="UIButtonLabel" enabled="true" height="0" hidden="true" knownSuperClass="UILabel" onScreen="false" parentHidden="true" tag="0" textColor="0x000000" top="false" visible="false" width="0" x="0" y="0"/>
         </UICalloutBarButton>
         <UICalloutBarButton accessibilityLabel="Show more items" alpha="1" class="UICalloutBarButton" enabled="true" height="0" hidden="true" knownSuperClass="UIButton" onScreen="false" parentHidden="true" tag="0" top="false" visible="false" width="0" x="0" y="0">
            <UIImageView alpha="1" class="UIImageView" enabled="false" height="0" hidden="false" knownSuperClass="UIImageView" onScreen="false" parentHidden="true" tag="0" top="false" visible="false" width="0" x="0" y="0"/>
            <UIButtonLabel alpha="1" class="UIButtonLabel" enabled="true" height="0" hidden="true" knownSuperClass="UILabel" onScreen="false" parentHidden="true" tag="0" textColor="0x000000" top="false" visible="false" width="0" x="0" y="0"/>
         </UICalloutBarButton>
      </UICalloutBar>
      <UIApplicationRotationFollowingControllerView alpha="1" backgroundColor="0x000000" class="UIApplicationRotationFollowingControllerView" enabled="false" height="1536" hidden="false" onScreen="true" tag="0" top="false" visible="true" width="2048" x="0" y="0"/>
   </UITextEffectsWindow>
</node>

Is there any significance of displaying only Windows information there? You can also find the attachment with the Windows hierarchy.

Below is the log info for the same issue:

Mon Oct 16 17:23:21 CDT 2017 [execute] Agent drop all zones
Mon Oct 16 17:23:21 CDT 2017 [execute] Start test test
Mon Oct 16 17:23:21 CDT 2017 [execute] C:\Users\munran\appiumstudio-reports\test31
Mon Oct 16 17:23:22 CDT 2017 [Command executing: setDevice] Set device to: ios_app:User 10
Mon Oct 16 17:23:22 CDT 2017 [Command executing: setDevice] Device Information
Name: User 10
S/N: 9ee4fdd5da9a38b183e8b82887e08a77d54af2b3
OS: iOS
Manufacture: Apple
Model: iPad Air
Version: 10.1.1
Screen size: 2048x1536
Connected to: 127.0.0.1:27015

2017-10-16 17:23:22,665 [Restlet-26829390-getVisualDump-sid:e20dc] (image.e.q) ERROR Exception while compiling xpath ‘//*[@class=‘WKWebView’’
javax.xml.transform.TransformerException: Expected ], but found:
at org.apache.xpath.compiler.XPathParser.error(XPathParser.java:610)
at org.apache.xpath.compiler.XPathParser.consumeExpected(XPathParser.java:528)
at org.apache.xpath.compiler.XPathParser.Predicate(XPathParser.java:1937)
at org.apache.xpath.compiler.XPathParser.Step(XPathParser.java:1726)
at org.apache.xpath.compiler.XPathParser.RelativeLocationPath(XPathParser.java:1626)
at org.apache.xpath.compiler.XPathParser.LocationPath(XPathParser.java:1597)
at org.apache.xpath.compiler.XPathParser.PathExpr(XPathParser.java:1317)
at org.apache.xpath.compiler.XPathParser.UnionExpr(XPathParser.java:1236)
at org.apache.xpath.compiler.XPathParser.UnaryExpr(XPathParser.java:1142)
at org.apache.xpath.compiler.XPathParser.MultiplicativeExpr(XPathParser.java:1063)
at org.apache.xpath.compiler.XPathParser.AdditiveExpr(XPathParser.java:1005)
at org.apache.xpath.compiler.XPathParser.RelationalExpr(XPathParser.java:930)
at org.apache.xpath.compiler.XPathParser.EqualityExpr(XPathParser.java:870)
at org.apache.xpath.compiler.XPathParser.AndExpr(XPathParser.java:834)
at org.apache.xpath.compiler.XPathParser.OrExpr(XPathParser.java:807)
at org.apache.xpath.compiler.XPathParser.Expr(XPathParser.java:790)
at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:129)
at org.apache.xpath.XPath.(XPath.java:178)
at org.apache.xpath.XPath.(XPath.java:266)
at org.apache.xpath.jaxp.XPathImpl.compile(XPathImpl.java:400)
at com.experitest.image.e.q.a(MyApplication:243)
at com.experitest.image.e.q.a(MyApplication:97)
at com.experitest.device.aL.a(MyApplication:1851)
at com.experitest.device.aL.a(MyApplication:1845)
at com.experitest.device.aL.a(MyApplication:1808)
at com.experitest.device.aN.b(MyApplication:1797)
at com.experitest.device.aN.f(MyApplication:1793)
at com.experitest.k.a.b.a(MyApplication:25)
at com.experitest.device.aL.a(MyApplication:1793)
at com.experitest.device.HybridWebElement.getIosWebElement(MyApplication:1635)
at com.experitest.device.HybridWebElement.createWebDump(MyApplication:230)
at com.experitest.image.agent.Q.a(MyApplication:24)
at com.experitest.image.agent.Controller.getVisualDump(MyApplication:10310)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.invoke(ReflectiveXmlRpcHandler.java:115)
at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.execute(ReflectiveXmlRpcHandler.java:106)
at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:46)
at com.experitest.image.agent.d.a(MyApplication:225)
at com.experitest.image.agent.d.a(MyApplication:164)
at com.experitest.utils.a.d.call(MyApplication:123)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
--------------- linked to ------------------
javax.xml.xpath.XPathExpressionException: javax.xml.transform.TransformerException: Expected ], but found:
at org.apache.xpath.jaxp.XPathImpl.compile(XPathImpl.java:408)
at com.experitest.image.e.q.a(MyApplication:243)
at com.experitest.image.e.q.a(MyApplication:97)
at com.experitest.device.aL.a(MyApplication:1851)
at com.experitest.device.aL.a(MyApplication:1845)
at com.experitest.device.aL.a(MyApplication:1808)
at com.experitest.device.aN.b(MyApplication:1797)
at com.experitest.device.aN.f(MyApplication:1793)
at com.experitest.k.a.b.a(MyApplication:25)
at com.experitest.device.aL.a(MyApplication:1793)
at com.experitest.device.HybridWebElement.getIosWebElement(MyApplication:1635)
at com.experitest.device.HybridWebElement.createWebDump(MyApplication:230)
at com.experitest.image.agent.Q.a(MyApplication:24)
at com.experitest.image.agent.Controller.getVisualDump(MyApplication:10310)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.invoke(ReflectiveXmlRpcHandler.java:115)
at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.execute(ReflectiveXmlRpcHandler.java:106)
at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:46)
at com.experitest.image.agent.d.a(MyApplication:225)
at com.experitest.image.agent.d.a(MyApplication:164)
at com.experitest.utils.a.d.call(MyApplication:123)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.xml.transform.TransformerException: Expected ], but found:
at org.apache.xpath.compiler.XPathParser.error(XPathParser.java:610)
at org.apache.xpath.compiler.XPathParser.consumeExpected(XPathParser.java:528)
at org.apache.xpath.compiler.XPathParser.Predicate(XPathParser.java:1937)
at org.apache.xpath.compiler.XPathParser.Step(XPathParser.java:1726)
at org.apache.xpath.compiler.XPathParser.RelativeLocationPath(XPathParser.java:1626)
at org.apache.xpath.compiler.XPathParser.LocationPath(XPathParser.java:1597)
at org.apache.xpath.compiler.XPathParser.PathExpr(XPathParser.java:1317)
at org.apache.xpath.compiler.XPathParser.UnionExpr(XPathParser.java:1236)
at org.apache.xpath.compiler.XPathParser.UnaryExpr(XPathParser.java:1142)
at org.apache.xpath.compiler.XPathParser.MultiplicativeExpr(XPathParser.java:1063)
at org.apache.xpath.compiler.XPathParser.AdditiveExpr(XPathParser.java:1005)
at org.apache.xpath.compiler.XPathParser.RelationalExpr(XPathParser.java:930)
at org.apache.xpath.compiler.XPathParser.EqualityExpr(XPathParser.java:870)
at org.apache.xpath.compiler.XPathParser.AndExpr(XPathParser.java:834)
at org.apache.xpath.compiler.XPathParser.OrExpr(XPathParser.java:807)
at org.apache.xpath.compiler.XPathParser.Expr(XPathParser.java:790)
at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:129)
at org.apache.xpath.XPath.(XPath.java:178)
at org.apache.xpath.XPath.(XPath.java:266)
at org.apache.xpath.jaxp.XPathImpl.compile(XPathImpl.java:400)
… 27 more
Mon Oct 16 17:23:22 CDT 2017 [Command executing: getVisualDump] Get visual dump: WEB
Mon Oct 16 17:23:22 CDT 2017 [Command executing: getVisualDump] <?xml version="1.0" encoding="UTF-8"?>

Mon Oct 16 17:23:24 CDT 2017 [execute] C:\Users\munran\appiumstudio-reports\test31