Appium skipping apk file installation inside docker container - java

I have linux machine with docker container where appium running on linux environment. Mobile device pluged in via USB(LG K22, Android 10) with all granted permissions. Adb devices displays this device. Apk provided with url. The problem is when I running tests the apk is not installing, its like skipping the installation, if app is already installed it doesn’t launch with appPackage and appActivity capabilities. Appium logs shows no errors. The test is running perfect locally on my Windows machine with this capabilities:
String apkLink = SettingsProvider.getPropertyValue("front.android.apk.link") +
"/" + SettingsProvider.getPropertyValue("front.android.version");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
capabilities.setCapability(MobileCapabilityType.APP, apkLink);
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "uiautomator2");
capabilities.setCapability("autoGrantPermissions", true);
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 220);
Where should I search for problem?

Related

Getting error in Appium "iproxy exited with code '208'" and app not getting launched on iOS mobile

On Mac machine using IOS real device 12.2 version the native app gets installed but does not launch and I could see error in Appium logs.
Appium Version:1.10.0
Xcode version: 10.2
IOS version 12.2
I am currently creating basic framework for mobile app testing
No solution found online.
caps.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
caps.setCapability(MobileCapabilityType.PLATFORM_VERSION, "12.2");
caps.setCapability("xcodeOrgid", "TCKV8EY4B5");
caps.setCapability("xcodeSigningid", "iPhone Developer");
caps.setCapability("bundleId", "de.cgi.le.flinc");
caps.setCapability(MobileCapabilityType.DEVICE_NAME, "Pooja iPhone");
caps.setCapability(MobileCapabilityType.UDID, "388f03938c82b5bc39313e6c8ffb6d7802dd9dbd");
caps.setCapability("app", app.getAbsolutePath());
caps.setCapability("automationName", "XCUITest");
//caps.setCapability("useNewWDA",true);
caps.setCapability("noReset", "true");
driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), caps);

Appium: Exception: Invalid server instance exception has occured: There is no installed nodes

I tried to start the appium server programmatically but encounter error. How to resolve this issues? I have nodejs installed and appium installed and environemnt variable set properly. I"m using maven appium java client 6.1.0 and selenium 3.14.0. Please help. A billion thanks for your help.
Code:
try {
File appDir = new File(System.getProperty("user.dir"));
File app = new File(appDir, "..\\apk\\Flipkart.apk");
// apk Capabilities
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("deviceName", "Sony Xperia Z2");
caps.setCapability("BROWSER_NAME", "Android");
caps.setCapability("platformVersion", "6.0");
caps.setCapability(MobileCapabilityType.PLATFORM_NAME, Platform.ANDROID);
//caps.setCapability("udid", "WUJ01N4RQ3"); // DeviceId from "adb devices" command
caps.setCapability("platformName", "Android");
caps.setCapability("app", app.getAbsolutePath());
caps.setCapability("appPackage", "com.flipkart.android");
caps.setCapability("appActivity","com.flipkart.android.SplashActivity");
// Appium Capabilities
caps.setCapability("skipUnlock","true");
caps.setCapability("noReset","false");
appiumBuilder = new AppiumServiceBuilder();
appiumBuilder.withIPAddress("127.0.0.1");
appiumBuilder.usingPort(47233);
appiumBuilder.withCapabilities(caps);
appiumBuilder.withStartUpTimeOut(3, TimeUnit.MINUTES);
appiumBuilder.withLogFile(new File(System.getProperty("user.dir") + "\\log\\appium.log"));
appiumBuilder.withArgument(GeneralServerFlag.SESSION_OVERRIDE);
appiumBuilder.withArgument(GeneralServerFlag.LOG_LEVEL, "DEBUG");
appiumBuilder.withArgument(GeneralServerFlag.ASYNC_TRACE, "true");
appiumServer = AppiumDriverLocalService.buildService(appiumBuilder);
appiumServer.start();
//new URL("http://127.0.0.1:47233/wd/hub")
driver = new AndroidDriver<MobileElement>(appiumServer, caps);
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
} catch (Exception ex) {
LogManager.logger.log(Level.INFO, "Exception: " + ex.getMessage());
}
Error Log:
INFO: Exception: Invalid server instance exception has occured: There
is no installed nodes! Please install node via NPM
(https://www.npmjs.com/package/appium#using-node-js) or download and
install Appium app (http://appium.io/downloads.html) Jan 03, 2019
3:52:12 PM com.peterwkc.testManager.AndroidManager tearDown INFO:
Exception: null
EDIT:
I believe appium source code cannot detect my installation of nodejs and appium.
Try installing Appium globally. This resolved the issue for me.
npm install -g appium
I faced the same issue at my end
Try to run the node server instance from command line, just type "node" and enter -- server should get started
Open another terminal window and just check if all details are been going good for the process running by doing "ps eww"
The node process running should be displayed here
Just kill the "node server", by typing "Killall node" on the same command window you did "ps eww"
The "node"window will show the process terminated.
Time for the truth, run your script and all should get going smoothly
I did this with
appium - 1.9.0
node - 11.9.0
npm version - 6.5.0
testscript - Java
tool - Eclipse
platform - iOS (10.14)
I got the same problem when using nvm although node already installed on all versions.
Finally, I decided to uninstall nvm and it's worked with the only node version

IntelliJ + Selenium + Appium Unable to find an active device or emulator with OS emulator 5554

I'm trying to open a Android device using Appium + Selenium. I have already made the virtual smartphone and I get an Error.
This is My Java code:
#Then("^I want to build a smartphone$")
public void i_want_to_build_a_smartphone() throws MalformedURLException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "emulator-5554");
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Chrome");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Browser");
mobiledriver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
//Connect to the webDriver server
}
And this is the Error I'm getting
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Unable to find an active device or emulator with OS emulator 5554. The following are available: emulator-5554 (8.1.0)
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z'
Always use following command to list available device adb devices
As per info in server logs
The following are available: emulator-5554 (8.1.0)
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "8.1.0");
Appium server logs are very helpful.It is always suggested to read them very carefully. They are self suggesting fix many time
Your platform version must be the os version of android not the
emulator name.
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "7.1");
//here you must put your emulator os version instead of 7.1
and you have two Browser_Name capabilities. Try removing one of
them.
Also make sure your emulator is running

Webview is not detected by appium webdriver on real IOS device

I am running the tests on a hybrid app. My configuration is: Xcode version set to '9.2' (tools v9.3.0.0.1.1521514116), Appium 1.7.2, and the capabilities are:
capabilities.setCapability("xcodeConfigFile", "/path/to/xcodeConfigFile.xcconfig");
capabilities.setCapability("newCommandTimeout", 600);
capabilities.setCapability("nativeWebTap", "true");
capabilities.setCapability("noReset", "true");
capabilities.setCapability("fullReset", "false");
capabilities.setCapability("chromedriverExecutable", chromeDriver);
capabilities.setCapability("bootstrapPath", "/Upath/to/appium-xcuitest-driver/WebDriverAgent");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, deviceName);
capabilities.setCapability("udid", UDID);
capabilities.setCapability("platformVersion", "11.2.6");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, platform);
capabilities.setCapability("app", iOSAppPath);
capabilities.setCapability("automationName" , "XCUITest");
If I use capabilities.setCapability("autoWebview", "true") the tests is stuck at driver initialization, as it does not find any webview.
webDriver.getContextHandles() returns only NATIVE_APP on a real device, but also returns WEBVIEW_2908.1 on the simulator.
The external libraries used are:
SaxonLiaison.jar
commons-lang3-3.1.jar
commons-validator-1.4.0.jar
guice-3.0.jar
java-client-4.1.2.jar
jcommander.jar
jxl-2.6.10.jar
log4j-1.2.16.jar
poi-3.10.1-20140818.jar
reportng-1.1.4.jar
saxon-8.7.jar
selenium-server-standalone-2.53.0.jar
smslib-3.5.4.jar
testng-6.8.21.jar
velocity-dep-1.4.jar
xslt.jar
I am unable to update to newer version because I get errors for some functionalities implemented in java-client-4.1.2.jar (for example webDriver.tap() )
As found on appium.io and other questions, I installed everything I could, like: ios-webkit-debug-proxy, libimobiledevice and ios-deploy
Edit: before I did not know that I had to manually run ios_webkit_debug_proxy, so I ran it three times with three different ports: 9221, 9222 and 9223, I received the same result and this is the only thing that was logged in the terminal:
ios_webkit_debug_proxy -c <udid>:9222
Connected :9222 to iPhone X (<udid>)
I found the solution to my issue here: https://github.com/appium/appium/issues/7676
I just had to start ios_webkit_debug_proxy and start appium server with a parameter that points to the ios_webkit_debug_proxy port
ios_webkit_debug_proxy -c UDID:27753 -d
appium --no-reset --webkit-debug-proxy-port 27753

Appium \ MAC OS \ Android \ Java - org.openqa.selenium.SessionNotCreatedException

I am trying to test Android device on MAC OS X, using Appium (in Java).
The build path includes these:
java-client-<version>.jar
java-client-<verson>-sources.jar
selenium-java-<version>.jar
selenium-server-standalone-<version>.jar
(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'?
You're saying that using the GUI launches the application? If that's the case, and what you're showing in code is your full DesiredCapabilities, then your capabilities would be the problem.
You can see what the capabilities the Appium GUI is using at the top with the text "Launching Appium with command".
If you set those flags in your capabilities, then the driver should connect properly.
You forgot to close the appium session by use driver.close()?
Try to restart your appium server.
P/s: When you don't want to close driver, you need enable Session override in appium GUI settings or add --session-override in appium command line. Then you don't need to restart appium server

Categories

Resources