Unable to determine type from: C. Last 41 characters read: { desiredCapabilities: { | Appium Forum
D
Deepak Posted on 12/04/2020

Hi team,

facing the following error, could you please help me in resolution, attached my code and error code.

 

My code:

 

 

package App;

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

import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileCapabilityType;


public class App1 {

public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub

DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(MobileCapabilityType.DEVICE_NAME, "RZ8M43BXSKE");
cap.setCapability(MobileCapabilityType.UDID, "RZ8M43BXSKE");
cap.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, "9");
cap.setCapability(MobileCapabilityType.APP, new File("This PC\\Deepak's Samsung \\Phone\\ExtractedApks\\MakeMyTrip_com.makemytrip.apk"));

try {
AndroidDriver<MobileElement> driver = new AndroidDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"),cap);
Thread.sleep(7000);
driver.quit();

} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

}

 

Error code:

 

Exception in thread "main" org.openqa.selenium.json.JsonException: Unable to determine type from: C. Last 41 characters read: {
"desiredCapabilities": {
"app": C
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: host: 'DESKTOP-H8I6M93', ip: '192.168.1.4', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_211'
Driver info: driver.version: AndroidDriver
at org.openqa.selenium.json.JsonInput.peek(JsonInput.java:122)
at org.openqa.selenium.json.JsonTypeCoercer.lambda$null$6(JsonTypeCoercer.java:140)
at org.openqa.selenium.json.JsonTypeCoercer.coerce(JsonTypeCoercer.java:126)
at org.openqa.selenium.json.MapCoercer.lambda$null$0(MapCoercer.java:68)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at org.openqa.selenium.json.MapCoercer.lambda$apply$1(MapCoercer.java:72)
at org.openqa.selenium.json.JsonTypeCoercer.lambda$null$6(JsonTypeCoercer.java:145)
at org.openqa.selenium.json.JsonTypeCoercer.coerce(JsonTypeCoercer.java:126)
at org.openqa.selenium.json.JsonInput.read(JsonInput.java:280)
at io.appium.java_client.remote.NewAppiumSessionPayload.getOss(NewAppiumSessionPayload.java:336)
at io.appium.java_client.remote.NewAppiumSessionPayload.<init>(NewAppiumSessionPayload.java:172)
at io.appium.java_client.remote.NewAppiumSessionPayload.create(NewAppiumSessionPayload.java:134)
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:175)
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:217)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:41)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:336)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:37)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:88)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:98)
at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:94)
at App.App1.main(App1.java:27)


A
Ashish Replied on 14/04/2020

new File("This PC\\Deepak's Samsung \\Phone\\ExtractedApks\\MakeMyTrip_com.makemytrip.apk"));

 

You havnt mentioned the drive name

"This PC" ????