I'm generally a tech noob and this is my first post here, so feel free to bash me for everything wrong about my post, so I better myself^^
I'm googling and searching stack overflow a while know for this issue, but most of the related topics revolve around simulators or have clearly different causes.
I'm running tests on Android and iOS Devices using Jenkins on a Mac mini with Appium Desktop. In the beginning of the Android tests I need to reboot the devices. I do so via adb reboot and unlock the devices via adb too. This all works fine and results in an unlocked Android device with active screen.
My Issue is, that when there are multiple physical devices connected to the Mac mini, I seemingly random run into the error, that Appium won't find the device I'm targeting via the udid, even though adb already unlocked the phone, so there definitely is a physical connection.
The devices also all show up when i run adb devices.
I can solve the issue by disconnecting some of the devices that are not the target of the current job.
I want to use two iOS and two Android-devices in total. Sometimes it works, but only until it doesn't.
It happens on different Macs too, but I don't know if this maybe even is a physical thing with the Macs, since I don't have the possibility to test it on Windows machines.
Here is the part of my Appium logs:
[info] [35m[AndroidDriver][39m Retrieving device list
[debug] [35m[ADB][39m Trying to find a connected android device
[debug] [35m[ADB][39m Getting connected devices
[debug] [35m[ADB][39m Connected devices: [{"udid":"97RAY11PXB","state":"device"}]
[error] [35m[AndroidDriver][39m Device 03JAYV27BX was not in the list of connected devices
Here is some of my jenkins console output:
org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Device 03JAYV27BX was not in the list of connected devices Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'Users-Mac-mini.local', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.7', java.version: '13.0.2' Driver info: driver.version: AndroidDriver remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Device 03JAYV27BX was not in the list of connected devices at getResponseForW3CError (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/lib/protocol/errors.js:804:9) at asyncHandler (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/lib/protocol/protocol.js:380:37) Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'Users-Mac-mini.local', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.7', java.version: '13.0.2' Driver info: driver.version: AndroidDriver at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:208) 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
Related
I've been trying to find a solution to this specific problem online all day. Let me provide as much information as I can.
I am using selenium grid 3, with windows server as the hub and my macbook as the node
Everything works as it should on the mac in chrome and firefox.
I took care of the setup in safari as expected (developer, allow automations, and then ran that safaridriver command on /usr/local/bin safaridriver (whatever that was))
When I set the browser to safari, it opens up as it should. The hub and node are properly configured to communicate.
My macbook is connected by HDMI to an HP 24 inch monitor.
When the the grid opens safari in the HP monitor, after it applies the driver.manage().window().maximize(), it shows 8 elements on the screen. Automation fails after that 8th element - It will not scroll past it at all.
When the grid opens safari in the macbook screen ("built-in retina display"), , after it applies the driver.manage().window().maximize(), it shows 4 elements on the screen. It scrolls once and shows the next 7 elements. But once it gets to that 7th element, automation fails. The error I get is:
org.openqa.selenium.WebDriverException:
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '[redacted]', ip: '[redacted]', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.5', java.version: '1.8.0_71'
Driver info: driver.version: unknown
Command duration or timeout: 78 milliseconds
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40'
System info: host: '[redacted]', ip: '[redacted]', os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_271'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{safari:diagnose=false, strictFileInteractability=false, platform=ANY, safari:automaticProfiling=false, webdriver.remote.sessionid=9834B185-E31A-4433-8F7F-0E035C280406, safari:platformBuildVersion=19F101, webkit:WebRTC={DisableICECandidateFiltering=false, DisableInsecureMediaCapture=false}, browserVersion=13.1.1, safari:useSimulator=false, acceptInsecureCerts=false, safari:platformVersion=10.15.5, browserName=Safari, safari:automaticInspection=false, platformName=macOS, setWindowRect=true}]
Session ID: 9834B185-E31A-4433-8F7F-0E035C280406
Is there anything in there that tells anyone what the issue is? I can't figure it out. I've tried adding scrolls, but I don't think I should have to for just this one browser, should I? There must be some configuration I could adjust? I tried removing the HDMI and using just the macbook itself, nothing I have tried works.
If anyone knows anything that could help, I'd appreciate it!
Though your Selenium version is 3.141.59 but your JDK version 1.8.0_71 is too old and ancient.
System info: host: '[redacted]', ip: '[redacted]', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.5', java.version: '1.8.0_71'
Solution
Ensure that:
JDK is upgraded to current levels JDK 8u271.
This question already has answers here:
SessionNotCreatedException: Message: session not created from disconnected: unable to connect to renderer with ChromeDriver 2.45 Chrome v71
(6 answers)
Closed 3 years ago.
Starting ChromeDriver 77.0.3865.40 (f484704e052e0b556f8030b65b953dce96503217-refs/branch-heads/3865#{#442}) on port 14991
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1573970978.437][SEVERE]: Unable to receive message from renderer
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created
from disconnected: Unable to receive message from renderer
(Session info: chrome=77.0.3865.120)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: host: 'DESKTOP-JCFLT7B', ip: '192.168.1.107', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '10.0.2'
Driver info: driver.version: ChromeDriver
This issue is occurs because your chrome browser version is not compatible with the chrome driver version. Check your chrome browser version and then install chrome driver from the below location based on your os.
https://chromedriver.chromium.org/downloads
for e.g:
I am using Version 78.0.3904.97 (Official Build) (64-bit) with windows and currently using chromedriver_win32.zip
I am using appium studio on windows to automate an app on iPhone.
When I am using bundle id its not working but when I am giving the app location xpath and clicking on it, it is launching the application.
Please help me to launch the application using bundle id.
DesiredCapabilities dCapabilities=new DesiredCapabilities();
URL url = new URL("http://localhost:5555/wd/hub");
dCapabilities.setCapability("reportDirectory","report");
dCapabilities.setCapability("fullReset", false);
dCapabilities.setCapability("reportFormat", "xml");
dCapabilities.setCapability("testName", "SampleTest");
dCapabilities.setCapability(IOSMobileCapabilityType.BUNDLE_ID,"au.com.chat.chatapp");
dCapabilities.setCapability(IOSMobileCapabilityType.LOCATION_SERVICES_AUTHORIZED,"true");
dCapabilities.setCapability(MobileCapabilityType.UDID, "00008020-00065C813E12002E");
driver = new IOSDriver<MobileElement>(url,dCapabilities);
org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: session not created (An unknown server-side error occurred. status='false'. Failed to complete internal method: 'launch args: [au.com.chat.chatapp, false, true]', details: Failed to launch activity / URL. The application: au.com.chat.chatapp is not installed on the device (reportUrl=C:\Users\system name\appiumstudio-reports\report\test25)) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 6.67 seconds
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: '10263TAB', ip: '10.10.32.60', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_221'
Driver info: driver.version: IOSDriver
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
It worked, I corrected the bundle id .
We are upgrading a previously-working Selenium/Java/Chrome test configuration, to newer versions:
ChromeDriver 2.35 -> 75.0.3770.90
Selenium Java 3.14 -> 3.141.59
macOS 10.14.5 (unchanged)
Java 11.0.3 (unchanged)
Chrome 75.0.3770.100 (unchanged)
However, when attempting to run a Selenium test, we see:
java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:28719
The full stack/log:
Starting ChromeDriver 75.0.3770.90 (a6dcaf7e3ec6f70a194cc25e8149475c6590e025-refs/branch-heads/3770#{#1003}) on port 28719
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
Jun 26, 2019 10:45:03 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
...
org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:28719
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'Craigs-iMac.local', ip: '192.168.1.131', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.5', java.version: '11.0.3'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:92)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:323)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByTagName(RemoteWebDriver.java:396)
at org.openqa.selenium.By$ByTagName.findElement(By.java:320)
All the resources I've found in this area suggest using --whitelisted-ips='', which did not have an effect, or were related to incompatible Selenium/Chrome/ChromeDriver versions, which I don't think is the issue here.
Update: I can confirm that the driver starts, and is listening on port 28719, but then stops at some point between startup and execution of the actual test. I've found no errors/logging related to the shutdown.
Update 2: I've debugged, and the initial commands sent to the remote driver succeed (setWindowSize()), but this line causes the driver to die silently:
((WebStorage) driver).getLocalStorage().setItem("token", token);
It seems newer versions of the ChromeDriver (Or Selenium? I don't know.) launch Chrome with an initial page sitting at the URL data:.
By adding these system properties prior to instantiating the ChromeDriver:
System.setProperty("webdriver.chrome.logfile", "/Users/craig/chromedriver.log");
System.setProperty("webdriver.chrome.verboseLogging", "true");
I was able to glean the following right before the driver quits:
[1561563455.971][INFO]: [01517094c63c0dd609c06a5622afe6b1] RESPONSE ExecuteScript ERROR <unknown>: Failed to read the 'localStorage' property from 'Window': Storage is disabled inside 'data:' URLs.
(Session info: headless chrome=75.0.3770.100)
So by changing this call in my test utility code:
((WebStorage) driver).getLocalStorage().setItem("token", token);
To this:
if (driver.getCurrentUrl().startsWith("data:")) {
// Driver will quit if we try to access localStorage without a page load
driver.get("/");
}
((WebStorage) driver).getLocalStorage().setItem("token", token);
Everything is now fine. https://i.imgur.com/edBQBeJ.gif
Editing:
LocalStorage is available only after launching any website. ie after driver.get
https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/html5/LocalStorage.html
I have a testing server for my phpunit, and now we want to add our codeception acceptance testing with selenium.
But as you the remote server has no "desktop" so it will not open a browser like in our developers computers.
I tried installing firefox on the machine but I still get this error:
Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: LINUX
Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:02:37'
System info: host: 'testdev', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version:
'3.2.0-23-generic', java.version: '1.7.0_65'
Driver info: driver.version: FirefoxDriver
so now I did this
WebDriver:
url: 'http://example.com/'
browser: firefox
capabilities:
binary: "/usr/bin/firefox"
and I get this error:
Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: no display specified
Error: no display specified
is it possible what I'm doing?
or I must have a "screen"?
In order to use Selenium with Firefox, or Chrome, etc - you need a linux distro that has a User Interface.
If you are on a linux machine that doesn't have a display (aka, just a terminal), then you can research Selenium HTMLUnit (headless browsing).
You could do headless browsing via the PHPBrowser, or you could install a GUI like xfce4 vnc4server, which will give you a virtual desktop to run Firefox in. This has the added bonus that you can watch the test run graphically.