(the version of the last 2 is the same), and TestNG.
Starting the Appium server (i am using the GUI) works fine and the application (which is already installed on the device) launches. Starting to debug my eclipse project which contains the following lines, i am getting the error for the 3rd line.
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "Plus");
AppiumDriver driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
The full error i am getting is:
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. Details: Problem getting session data for driver type AndroidDriver; does it implement 'get driverData'?
Sometimes I got the same error but normally I end finding an own mistake.
Make sure your previous session has closed correctly, or all the capabilities you provided are correct (in client), make sure you donāt have another server instance running in backgroundā¦ Things like that can broke the handshake between client and server.
i am getting error even if i have handled exception , its not performing try catch operation and throws no such element exception , please anyone can help in this : my code---------------
caps.setCapability(āautoGrantPermissionsā, ātrueā);
AndroidDriver driver = new AndroidDriver(new URL(āhttp://0.0.0.0:4723/wd/hubā),caps);
// driver.findElement(MobileBy.id(āpermission_allow_buttonā)).click();
driver.pressKeyCode(AndroidKeyCode.KEYCODE_HOME);
Thread.sleep(5000);
driver.findElement(By.xpath("//android.widget.TextView[@text=āAppsā]")).click();
Thread.sleep(5000);
MobileElement e = (MobileElement) driver.findElement(By.xpath("//android.widget.TextView[@text=āSettingsā]")); try{
** while(e.isDisplayed())**
** {e.click();**
** break;**
The Exception is thrown at the line where you wrote <ādriver.findElement(By.xpath(āyour_xpathā))ā> which is not enclosed within try block. Enclose this line within try{} block and also add implicit timeout for driver instance so that it will keep finding element multiple time.