Receive org.openqa.selenium.WebDriverException:No Command or response codec has been defined. Unable to proceed

Hello,

I receive the above error when trying to execute a simple test case where i just scroll to on the mobile app using ios emulator with the UICatalog app installed on my local machine.
Im running Appium 1.5.3, Java client 2.1.0 and Selenium Jars 3.0.0

Can someone please help.

The code is below:

public class AutomatingA {

IOSDriver driver;


@Before
public void setup() throws MalformedURLException {
	
	// TODO Auto-generated method stub
	
	DesiredCapabilities cap=new DesiredCapabilities();
	File f=new File("/Users/qtb8926/Desktop/UI-Catalog-App.zip");
	cap.setCapability(MobileCapabilityType.PLATFORM_VERSION,"9.3");
	cap.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 6");
	cap.setCapability(MobileCapabilityType.BROWSER_NAME, "");
	cap.setCapability(MobileCapabilityType.APP, f.getAbsolutePath());
	cap.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT,"100");
	driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"),cap);
	
	
}

@Test
public void controls() {
	driver.scrollTo("Controls");
}

}

I am facing the same error for Android. I am running Appium 1.4.16.1 Windows client and Selenium Jars 3.0.1

Error Log:

Exception in thread “main” org.openqa.selenium.WebDriverException: No command or response codec has been defined. Unable to proceed
Build info: version: ‘unknown’, revision: ‘1969d75’, time: ‘2016-10-18 09:43:45 -0700’
System info: host: ‘TestInsane’, ip: ‘192.168.0.104’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_111’
Driver info: driver.version: AppiumDriver
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:153)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:180)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteTimeouts.implicitlyWait(RemoteWebDriver.java:822)
at Calculator.main(Calculator.java:51)

hi ,
I am facing same problem using app testing
Exception in thread “main” org.openqa.selenium.WebDriverException: No command or response codec has been defined. Unable to proceed
Build info: version: ‘unknown’, revision: ‘1969d75’, time: ‘2016-10-18 09:43:45 -0700’
System info: host: ‘Shekar’, ip: ‘192.168.1.13’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_102’
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:153)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:180)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:368)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:473)
at org.openqa.selenium.By$ByXPath.findElement(By.java:361)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:360)
at com.appium.project.WhatsappApp.main(WhatsappApp.java:25)

hi ,
This is another problem i faced in appium using site testing in mobile

Exception in thread “main” org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: ‘unknown’, revision: ‘c7b525d’, time: ‘2016-09-01 14:52:30 -0700’
System info: host: ‘Shekar’, ip: ‘192.168.1.13’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_102’
Driver info: driver.version: RemoteWebDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, chrome={chromedriverVersion=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf)}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=true, version=54.0.2840.85, platform=ANDROID, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 3b093b0259c11bb4ad79b9f4faf9a4d3
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:618)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:180)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:323)
at com.amma.appium.Test1.main(Test1.java:57)
Caused by: org.openqa.selenium.WebDriverException: No command or response codec has been defined. Unable to proceed
Build info: version: ‘unknown’, revision: ‘c7b525d’, time: ‘2016-09-01 14:52:30 -0700’
System info: host: ‘Shekar’, ip: ‘192.168.1.13’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_102’
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:153)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:597)
… 3 more

Hi,
I am also facing the same issue while running the mobile test cases.
Here is the details

package AndroidAutomation;

import static org.junit.Assert.*;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;

import org.junit.Test;
import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileBrowserType;
import io.appium.java_client.remote.MobileCapabilityType;
import io.appium.java_client.remote.MobilePlatform;

public class desiredcapabilities {

@Test
public void test() throws MalformedURLException {
	
	File appDir = new File("src");
	File app = new File(appDir,"com.bt.bms_5.0.11.apk");
	DesiredCapabilities cap = new DesiredCapabilities();
	cap.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);
	cap.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
	cap.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, "500");
	cap.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
	AndroidDriver driver=new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),cap );
	//cap.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, "100");
	System.out.println("harish click no thanks");
	cap.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, "5000");

	driver.findElementById("com.bt.bms:id/language_hindi").click();


	

	//driver.findElementByClassName("android.widget.TextView").click();
	
	
	
	
}

}

Error : one step where i am clicking on the button its giving me the error

org.openqa.selenium.WebDriverException: No command or response codec has been defined. Unable to proceed
Build info: version: ‘unknown’, revision: ‘1969d75’, time: ‘2016-10-18 09:43:45 -0700’
System info: host: ‘m-C02S6BYWG8WN’, ip: ‘172.28.124.67’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.12.2’, java.version: ‘1.8.0_111’
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:153)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:180)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:368)
at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:417)
at AndroidAutomation.desiredcapabilities.test(desiredcapabilities.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

Please let me now how i can resolve the issue.

I was facing the same issue and i wasn’t able to resolve it… But my code is working fine now … It was due to the multiple sdk paths set on the enviornmental variables on JAVA_HOME… Moreover, i have also changed the java_client libraries to the latest and issue is gone now… Please do try this solution… Hope it will work. Thanks :slight_smile:

Any solution i have tried everything

Hey Guys!
Just Update the Java Client version to latest version.download link below
**

https://mvnrepository.com/artifact/io.appium/java-client/4.1.2

**

Let me know if it is work.

1 Like

Yes, this worked.
Just update the version of java-client in your pom.xml