# Unable to perform webview elements,pls help

**URL:** <https://discuss.appium.io/t/unable-to-perform-webview-elements-pls-help/942>\
**Category:** Issues/Bugs\
**Created:** [October 20, 2014, 10:04am UTC](https://discuss.appium.io/t/unable-to-perform-webview-elements-pls-help/942 "2014-10-20T10:04:10Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![akira](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@akira](https://discuss.appium.io/u/akira)\
**Post date:** [October 20, 2014, 10:04am UTC](https://discuss.appium.io/t/unable-to-perform-webview-elements-pls-help/942/1 "2014-10-20T10:04:10Z")

</div>

android env:  
driver.context(“WEBVIEW”);  
System.out.println("-----------------------------");  
WebElement email = driver.findElementById(“login\_email”); \<----appium throws error here

below is the error trace:  
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. (WARNING: The server did not provide any stacktrace information)  
Command duration or timeout: 1.03 seconds  
Build info: version: ‘2.42.2’, revision: ‘6a6995d31c7c56c340d6f45a76976d43506cd6cc’, time: ‘2014-06-03 10:52:47’  
System info: host: ‘PC-20140519QFMN’, ip: ‘172.20.1.58’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0\_05’  
Driver info: io.appium.java\_client.AppiumDriver  
Capabilities [{appPackage=com.gamelala.android.trivialdrivesample, networkConnectionEnabled=true, warnings={}, databaseEnabled=false, deviceName=Android Emulator, platform=LINUX, appActivity=.DemoActivity, desired={appPackage=com.gamelala.android.trivialdrivesample, appActivity=.DemoActivity, platformVersion=4.4.2, browserName=, platformName=Android, deviceName=Android Emulator}, platformVersion=4.4.2, webStorageEnabled=false, locationContextEnabled=false, browserName=, takesScreenshot=true, javascriptEnabled=true, platformName=Android}]  
Session ID: a2c42115-319c-42bb-9bbb-e34b5e769f10  
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)  
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)  
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)  
at java.lang.reflect.Constructor.newInstance(Unknown Source)  
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)  
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)  
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)  
at io.appium.java\_client.AppiumDriver.execute(AppiumDriver.java:95)  
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:352)  
at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:393)  
at Gamelala\_01.GL\_PAY.MainProcess.a\_Paypal\_Ts(MainProcess.java:88)  
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)  
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)  
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)  
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)  
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)  
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)  
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)  
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)  
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)  
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)  
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)  
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)  
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)  
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)  
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)  
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)  
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)  
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

---

<div class="post-metadata">

**Author:** ![Priyank\_Shah](https://discuss.appium.io/user_avatar/discuss.appium.io/priyank_shah/32/5628_2.png) [@Priyank\_Shah](https://discuss.appium.io/u/Priyank_Shah)\
**Post date:** [October 20, 2014, 10:26am UTC](https://discuss.appium.io/t/unable-to-perform-webview-elements-pls-help/942/2 "2014-10-20T10:26:48Z")

</div>

Please provide more details?

---

<div class="post-metadata">

**Author:** ![akira](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@akira](https://discuss.appium.io/u/akira)\
**Post date:** [October 20, 2014, 10:37am UTC](https://discuss.appium.io/t/unable-to-perform-webview-elements-pls-help/942/3 "2014-10-20T10:37:23Z")

</div>

```
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
    capabilities.setCapability("deviceName", "Android Emulator");
    capabilities.setCapability("platformVersion", "4.4.2");
    capabilities.setCapability("platformName", "Android");
    //capabilities.setCapability("device", "Selendroid");
    capabilities.setCapability("appPackage",
            "com.abc.android.trivialdrivesample");
    capabilities.setCapability("appActivity", ".DemoActivity");

    AppiumDriver driver;
    driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"),
            capabilities);
    Thread.sleep(3000);

    String x = null;
    String rs = a01.get_paypalVal_from_RDSTR();
    a03.writeExcute(rs);
    CopyCFG.copyExecute();
    System.out.println(rs);
    rs = "F0";
    WebElement step1 = driver.findElement(By
            .id("com.abc.android.trivialdrivesample:id/bt_pay_3y"));
    step1.click();
    Thread.sleep(6000);
    Assert.assertNotNull(step1);
    WebElement step2 = driver.findElement(By
            .id("com.abc.android.trivialdrivesample:id/et_money"));
    step2.clear();
    step2.sendKeys(rs);
    WebElement step3 = driver.findElement(By
            .id("com.abc.android.trivialdrivesample:id/bt_buy"));
    step3.click();
    Thread.sleep(6000);
    WebElement step4 = driver
            .findElement(By
                    .id("com.abc.android.trivialdrivesample:id/rb_paypal_pay"));
    step4.click();
    WebElement step5 = driver.findElement(By
            .id("com.abc.android.trivialdrivesample:id/bt_save"));
    step5.click();
    Thread.sleep(50000);
    driver.context("WEBVIEW");
    System.out.println(driver.getContext());
    System.out.println("-----------------------------");
    WebElement email = driver.findElementById("login_email");
```

---

<div class="post-metadata">

**Author:** ![akira](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@akira](https://discuss.appium.io/u/akira)\
**Post date:** [October 20, 2014, 10:40am UTC](https://discuss.appium.io/t/unable-to-perform-webview-elements-pls-help/942/4 "2014-10-20T10:40:37Z")

</div>

for Native view , it’s ok  
but when it switch to webview by driver.context(“WEBVIEW”); appium throws the previous error  
the error detail is 😄  
org.openqa.selenium.WebDriverException: An unknown server-side error  
occurred while processing the command. (WARNING: The server did not  
provide any stacktrace information)  
Command duration or timeout: 1.03 seconds  
Build info: version: ‘2.42.2’, revision: ‘6a6995d31c7c56c340d6f45a76976d43506cd6cc’, time: ‘2014-06-03 10:52:47’  
System  
info: host: ‘PC-20140519QFMN’, ip: ‘172.20.1.58’, os.name: ‘Windows 7’,  
os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0\_05’  
Driver info: io.appium.java\_client.AppiumDriver  
Capabilities  
[{appPackage=com.gamelala.android.trivialdrivesample,  
networkConnectionEnabled=true, warnings={}, databaseEnabled=false,  
deviceName=Android Emulator, platform=LINUX, appActivity=.DemoActivity,  
desired={appPackage=com.gamelala.android.trivialdrivesample,  
appActivity=.DemoActivity, platformVersion=4.4.2, browserName=,  
platformName=Android, deviceName=Android Emulator},  
platformVersion=4.4.2, webStorageEnabled=false,  
locationContextEnabled=false, browserName=, takesScreenshot=true,  
javascriptEnabled=true, platformName=Android}]  
Session ID: a2c42115-319c-42bb-9bbb-e34b5e769f10  
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)  
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)  
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)  
at java.lang.reflect.Constructor.newInstance(Unknown Source)  
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)  
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)  
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)  
at io.appium.java\_client.AppiumDriver.execute(AppiumDriver.java:95)  
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:352)  
at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:393)  
at Gamelala\_01.GL\_PAY.MainProcess.a\_Paypal\_Ts(MainProcess.java:88)  
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)  
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)  
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)  
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)  
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)  
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)  
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)  
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)  
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)  
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)  
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)  
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)  
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)  
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)  
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)  
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)  
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)  
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

---

<div class="post-metadata">

**Author:** ![akira](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@akira](https://discuss.appium.io/u/akira)\
**Post date:** [October 20, 2014, 10:44am UTC](https://discuss.appium.io/t/unable-to-perform-webview-elements-pls-help/942/5 "2014-10-20T10:44:03Z")

</div>

platform is 4.4.2  
api level is 19  
cpu/ABI : ARM(armeabi-v7a)  
and i run my appium scripts in android-emulator

---

<div class="post-metadata">

**Author:** ![akira](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@akira](https://discuss.appium.io/u/akira)\
**Post date:** [October 20, 2014, 10:46am UTC](https://discuss.appium.io/t/unable-to-perform-webview-elements-pls-help/942/6 "2014-10-20T10:46:30Z")

</div>

when it calls driver.findElementById(“login\_email”), the error message is thrown.

---

<div class="post-metadata">

**Author:** ![Priyank\_Shah](https://discuss.appium.io/user_avatar/discuss.appium.io/priyank_shah/32/5628_2.png) [@Priyank\_Shah](https://discuss.appium.io/u/Priyank_Shah)\
**Post date:** [October 20, 2014, 12:26pm UTC](https://discuss.appium.io/t/unable-to-perform-webview-elements-pls-help/942/7 "2014-10-20T12:26:39Z")

</div>

First thing, if u r using API 4.4.2 then why do u run test with selendroid mode. So first change this to Appium mode. Kindly run ur scripts and let me know the results.

Thanks,  
Priyank Shah

---

<div class="post-metadata">

**Author:** ![akira](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@akira](https://discuss.appium.io/u/akira)\
**Post date:** [October 21, 2014, 2:31am UTC](https://discuss.appium.io/t/unable-to-perform-webview-elements-pls-help/942/8 "2014-10-21T02:31:35Z")

</div>

but the selendroid mode was annotated, [//capabilities.setCapability](https://capabilities.setCapability)(“device”, “Selendroid”);

---

<div class="post-metadata">

**Author:** ![akira](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@akira](https://discuss.appium.io/u/akira)\
**Post date:** [October 21, 2014, 4:23am UTC](https://discuss.appium.io/t/unable-to-perform-webview-elements-pls-help/942/9 "2014-10-21T04:23:53Z")

</div>

i tried this test code:  
Set contextNames = driver.getContextHandles();

```
    for (String contextName : contextNames) {

        System.out.println(contextName); 

    }

```

and it returns  
WEBVIEW\_com.test.android.trivialdrivesample

how to set the param of driver.context();  
driver.context(“WEBVIEW”) ?

---

<div class="post-metadata">

**Author:** ![Priyank\_Shah](https://discuss.appium.io/user_avatar/discuss.appium.io/priyank_shah/32/5628_2.png) [@Priyank\_Shah](https://discuss.appium.io/u/Priyank_Shah)\
**Post date:** [October 21, 2014, 6:34am UTC](https://discuss.appium.io/t/unable-to-perform-webview-elements-pls-help/942/10 "2014-10-21T06:34:26Z")

</div>

yes, so you changed selendroid capability?

---

<div class="post-metadata">

**Author:** ![akira](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@akira](https://discuss.appium.io/u/akira)\
**Post date:** [October 22, 2014, 11:00am UTC](https://discuss.appium.io/t/unable-to-perform-webview-elements-pls-help/942/11 "2014-10-22T11:00:02Z")

</div>

i tried selendroid ,but also failed

---

<div class="post-metadata">

**Author:** ![akira](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@akira](https://discuss.appium.io/u/akira)\
**Post date:** [October 22, 2014, 11:00am UTC](https://discuss.appium.io/t/unable-to-perform-webview-elements-pls-help/942/12 "2014-10-22T11:00:42Z")

</div>

![](https://discuss.appium.io/uploads/default/293/99fc3d198ee69671.jpg)

---

<div class="post-metadata">

**Author:** ![akira](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@akira](https://discuss.appium.io/u/akira)\
**Post date:** [October 22, 2014, 11:01am UTC](https://discuss.appium.io/t/unable-to-perform-webview-elements-pls-help/942/13 "2014-10-22T11:01:32Z")

</div>

i just want to locate an element on a webview,why it always says:  
ebug: Responding to client with error: {“status”:13,“value”:{“message”:“An unknown server-side error occurred while processing the command.”,“origValue”:“unknown error: Function already created: concat.\n (Session info: chrome=webview)\n (Driver info: chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86\_64)”},“sessionId”:“88c5b62c-fa17-46c5-a0db-af156701d08f”}

> debug: Didn’t get a new command in 60 secs, shutting down…

---

<div class="post-metadata">

**Author:** ![Jimit24365](https://discuss.appium.io/user_avatar/discuss.appium.io/jimit24365/32/8895_2.png) [@Jimit24365](https://discuss.appium.io/u/Jimit24365)\
**Post date:** [February 23, 2015, 9:14am UTC](https://discuss.appium.io/t/unable-to-perform-webview-elements-pls-help/942/14 "2015-02-23T09:14:50Z")

</div>

just set it as follow

driver.context(contextNames.toArray()[index of mentioned webView context].toString());
