Jenkins + Selenium random unknown server-side error during Karma+Mocha tests - javascript

I have CI system. It consists of
Jenkins Master server (version 2.60.2) running on Ubuntu 16.04
Jenkins slaves Swarm Slave (version 3.4.1) running on Ubuntu 16.04
Selenium hub (version 3.4.0) running on Ubuntu 16.04
4 Selenium nodes for Safari Browser (version 3.4.0) Running on Mac OS Siera 10.12.5 .
With Safari 10.
Im testing Java Script project that uses Mocha+Karma to run tests.
Most of the time everything is working as it should.
But sometimes i have error like this one.
{"message":"[get(\"http://my-jenkins-slave-hostname:9876/?id=39481\")] Error response status: 13, UnknownError - An unknown server-side error occurred while processing the command. Selenium error: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 8 path $","status":13,"cause":{"value":{"stacktrace":"com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient...
It looks like some nodes of selenium sometimes fail randomly.
All nodes are exact replicas of same image (Im using Mac Stadium to manage Mac OS nodes)
Ive tried to configure Karma to give more details in logs, ive tried to increase timeouts, but no luck. Error message stays the same.
How can i troubleshoot such problem?
Any ideas?

Related

Can't get out of the Visual Studio 2019 sandbox to access LAN

I’m using Visual Studio 2019 to develop a Taskpane for Excel to download sensor data to a spreadsheet. I’m obtaining the data over Wi-Fi via an ESP8266 TCP socket server module which is a node on my LAN(thus the URL 192.168.0.7:81). The html and Javascript work fine in Internet Explorer(IE). There is no password or LAN SSID involved.
The Javascript builds fine in VS2019 but immediately fails in debug.
Javascript:
Home.js contains:
line 8 - var connection = new WebSocket(‘ws://’ + ‘192.168.0.7’ + ‘:81/’, [‘arduino’]);
Upon Debug:
Build Succeeded with 0 Errors
'iexplore.exe' (Script): Loaded 'Script Code (Windows Internet Explorer)'.
Unhandled exception at line 8, column 1 in https://localhost:44390/Home/Home.js
0x800a139e - JavaScript runtime error: SecurityError
The program '[11136] iisexpress.exe' has exited with code 0 (0x0).
The program '[2236] EXCEL.EXE' has exited with code 0 (0x0).
The program '[10844] iexplore.exe' has exited with code 1 (0x1).
I’ve looked everywhere for explanations of the 0x800a139e SecurityError but found nothing that helped solve the problem.
It appears to be a general JS syntax error but the code works fine in IE and IE is the selected browser in VS2019. Running Code Analysis shows no errors with the JS. Note: I'm using straight JS for this not jquery because, as I understand it, jquery is simply a library that converts to JS for compilation and I have no clue how this line would be constructed in jquery.
Also, if I use Tools/Connect to Server it cannot find 192.168.0.7. Is this because it only looks for sql servers or because I have a VS2019 configuration problem?
This is most frustrating due to lack of specific error definition.
Thanks

Error shows when I have the correct set up. "SessionNotCreatedError: session not created: Chrome version must be between 70 and 73"

I was doing an automate testing with selenium-webdriver. I am building a driver using chromedriver. It was working good but one day I run a test and this following error message shows up
SessionNotCreatedError: session not created: Chrome version must be between 70 and 73
(Driver info: chromedriver=73.0.3683.20 (8e2b610813e167eee3619ac4ce6e42e3ec622017),platform=Mac OS X 10.14.3 x86_64)
but I have no idea what is going on that my package.json shows me it is chromedriver^73.0.0.0. An I have try to uninstall the previous version v2.45, and this similar message shows up.
I have tried so many times for doing npm uninstall and install, also try to install locally but does not help. I know update to v74 works, but some for some reason, i need to stay with the version v73.
Does anyone how to solve this?
I think there is an mismatch between your chrome browser and driver. Downgrade your chrome browser, please.

TypeError: 'NoneType' object is not subscriptable while invoking execute_script() for Chrome Download Manager through Selenium

I have been using this function https://stackoverflow.com/a/48267887/11220889 for waiting for downloads to finish and returning the file path once finished. And it has been working great until now.
The Function
def every_downloads_chrome(driver):
if not driver.current_url.startswith("chrome://downloads"):
driver.get("chrome://downloads/")
return driver.execute_script('''
var items = downloads.Manager.get().items_;
if (items.every(e => e.state === "COMPLETE"))
return items.map(e => e.file_url);
''')
How its called
paths = WebDriverWait(driver, 120, 1).until(every_downloads_chrome)
Error I'm receiving
TypeError: 'NoneType' object is not subscriptable
So from what I can gather something has changed that has started causing the function to not return a path. I believe this is due to a change within chrome or even more specifically the chrome driver. My two reasons for this assumption is:
1) I had this function in another code that my colleague was using and she called me saying it was producing this error yesterday.
2)Neither code has changed so the change must be in chrome
I would like to keep using this script but if not possible have another function that waits for the downloads to finish and returns the paths and ideally does it all through the driver not through file path since multiple users use my codes on multiple machines.
EDIT: Versions-
Name: selenium
Version: 3.141.0
Name: Chrome Browser
Version: 73.0.3683.86
Name: Chrome Driver
Version: 2.43.600210
Name: System
Version: Windows 10 Pro x64
As per the error message:
TypeError: 'NoneType' object is not subscriptable
Your main issue seems to be incompatibility between the version of the binaries you are using as follows:
You are using chromedriver=2.43
Release Notes of chromedriver=2.43 clearly mentions the following :
Supports Chrome v69-71
You are using chrome=73.0
Release Notes of ChromeDriver v2.46 clearly mentions the following :
Supports Chrome v71-73
So there is a clear mismatch between ChromeDriver v2.43 and the Chrome Browser v73.0
Solution
Upgrade ChromeDriver to current ChromeDriver v2.46 level.
Keep Chrome version at Chrome v73 level. (as per ChromeDriver v2.46 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
Execute your #Test.
Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
Update
Currently GAed Chrome v73 have some issues and you may like to downgrade to Chrome v72. You can find a couple of relevant discussions in:
Getting Timed out receiving message from renderer: 600.000 When we execute selenium scripts using Jenkins windows service mode
Timed out receiving message from renderer: 10.000 while capturing screenshot using chromedriver and chrome through Jenkins on Windows

Intel xdk daemon with intel galileo gen2

I am trying working on Intel Galileo Gen 2 with Intel XDK and successfully connected galileo gen 2 with XDK manually over ethernet as its not detecting board, i have installed bonjour also.
I have also created new project without any error but when I am uploading the code its showing error that daemon is old please install least version 0.1.3. When i am trying to upgrade its showing another error I have attached the snapshot of the error.
I have tried all the methods like restarting the system board, uninstalling the XDK IoT edition and installed new XDK 3641.
I have updated other libraries and restarted the daemon but getting same error.
I have tried checking whether daemon is working or not and found no error.
Only one error i am getting couldn't update daemon
Error: TypeError: Invalid Version: 4.x.x
I am also unable to install Intel system studio following all the steps as mentioned on guide at Intel website. It showing error of
Can't create/start docker machine: Running pre-create checks...
Error with pre-create check: "This computer doesn't have VT-X/AMD-v
enabled. Enabling it in the BIOS is mandatory"
finished with error 3.
Regarding use of your Galileo with the XDK, try downloading and installing version 3759 at http://xdk.intel.com. This is a new update (yesterday) that includes some code to specifically address updating the XDK daemon on IoT target boards. Please let me know if it works.
BTW -- no need to uninstall/reinstall the XDK if this fails. If it fails it is likely something to do with the version of Linux on the Galileo, the network connection or the XDK itself. If it does fail, please report the issue on our forum at https://software.intel.com/en-us/forums/intel-xdk

Can't connect to local Node App

I just started with a little bit MEAN-Magic by following along this tutorial. It was working pretty good (installation and so on). Now I'm stuck at:
STEP 4: Creating an ExpressJS application
I executed express mytestapp, cd mytestapp, npm installand node app.jsand am able to see the folder structure in the Terminal, but if I open Safari with "http://localhost:3000" I get the message
Safari can't Connect To Server... Safari can't open the page "localhost:3000" because Safari can't connect to the server "localhost"
How can I troubleshoot this? I'm totally new to this. (Not sure if this matters, but I'm working from a mac at the moment).

Categories