Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message:
An unknown server-side error occurred while processing the command. Original error: Cannot verify the signature of
‘C:UsersgeetbAppDataLocalProgramsAppium Server GUIresourcesappnode_modulesappiumnode_modulesappium-uiautomator2-server
apksappium-uiautomator2-server-v4.27.0.apk’. Original error: The ‘java.exe’ binary could not be found neither in PATH nor
under JAVA_HOME
(The JAVA_HOME location ‘C:Program FilesAndroidAndroid Studiojre;C:Program FilesJavajdk-17;’ must exist)
My code:
package MobileScript;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.options.UiAutomator2Options;
public class FirstappiumScript {
static AndroidDriver driver;
public static void main(String[] args) throws MalformedURLException, InterruptedException {
// TODO Auto-generated method stub
DesiredCapabilities capabilities = new DesiredCapabilities();
UiAutomator2Options options = new UiAutomator2Options();
options.setDeviceName(“CU4PPV6D7DTW5DZ9”);
System.getProperty(“user.dir”);
options.setApp(“C:UsersgeetbOneDriveDocumentsAppiumScriptAppiumScriptsrcsoftwareselendroid-test-app-0.17.0.apk”);
options.setCapability(“skipServerInstallation”, true);
URL url = new URL(“http://0.0.0.0:4723/wd/hub”);
driver = new AndroidDriver(options);
driver.get(“http://www.google.com”);
Thread.sleep(10000);
driver.quit();
Selenium version : 4.1.0
Java Client version : java-client-8.0.0-beta
My Java version
enter image description here
Java_home and path
enter image description here
PATH
enter image description here
Appium LOG:
Link – https://drive.google.com/file/d/1uPr3JIHRDTXpp0colEWlxR6r2sMuxdmb/view?usp=sharing
I tried downgrading the java version uninstalled and installed java versions yet i am facing this error unable to create a session . Could somebody Please help.`
Geetha s is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.