Skip to content

Cannot read properties of null (reading 'split') #59

@elgui1886

Description

@elgui1886

Hi guys,
when running jest tests with browserstack, i got this error:

 error: TypeError: Cannot read properties of null (reading 'split')
    at exports.<computed> [as compareVersions] (C:\Users\guidiel\projects\ui.application.video.admin\node_modules\browserstack-node-sdk\src\helpers\helper.js:1:153412)
    at new BrowserStackSetup (C:\Users\guidiel\projects\ui.application.video.admin\node_modules\browserstack-node-sdk\src\helpers\BrowserStackSetup.js:1:12751)  
    at run (C:\Users\guidiel\projects\ui.application.video.admin\node_modules\browserstack-node-sdk\src\bin\jest\command.js:2:6023)
    at Object.KKFpx (C:\Users\guidiel\projects\ui.application.video.admin\node_modules\browserstack-node-sdk\src\bin\runner.js:2:3480)
    at captureError (C:\Users\guidiel\projects\ui.application.video.admin\node_modules\browserstack-node-sdk\src\bin\runner.js:2:3645)
    at Object.IkCFq (C:\Users\guidiel\projects\ui.application.video.admin\node_modules\browserstack-node-sdk\src\bin\runner.js:2:6127)
    at C:\Users\guidiel\projects\ui.application.video.admin\node_modules\browserstack-node-sdk\src\bin\runner.js:2:6448
    at _.applyBuilderUpdateUsageAndParse (C:\Users\guidiel\projects\ui.application.video.admin\node_modules\yargs\build\index.cjs:1:7435)
    at _.runCommand (C:\Users\guidiel\projects\ui.application.video.admin\node_modules\yargs\build\index.cjs:1:7078)
    at [runYargsParserAndExecuteCommands] (C:\Users\guidiel\projects\ui.application.video.admin\node_modules\yargs\build\index.cjs:1:58539)

This is my browserstack file:

# =============================
# Set BrowserStack Credentials
# =============================
# Add your BrowserStack userName and accessKey here or set BROWSERSTACK_USERNAME and
# BROWSERSTACK_ACCESS_KEY as env variables
userName: userName
accessKey: accessKey

# ======================
# BrowserStack Reporting
# ======================
# The following capabilities are used to set up reporting on BrowserStack:
# Set 'projectName' to the name of your project. Example, Marketing Website
projectName: BrowserStack Samples
# Set `buildName` as the name of the job / testsuite being run
buildName: browserstack build
# `buildIdentifier` is a unique id to differentiate every execution that gets appended to
# buildName. Choose your buildIdentifier format from the available expressions:
# ${BUILD_NUMBER} (Default): Generates an incremental counter with every execution
# ${DATE_TIME}: Generates a Timestamp with every execution. Eg. 05-Nov-19:30
# Read more about buildIdentifiers here -> https://www.browserstack.com/docs/automate/selenium/organize-tests
buildIdentifier: '#${BUILD_NUMBER}' # Supports strings along with either/both ${expression}

# =======================================
# Platforms (Browsers / Devices to test)
# =======================================
# Platforms object contains all the browser / device combinations you want to test on.
# Entire list available here -> (https://www.browserstack.com/list-of-browsers-and-platforms/automate)
platforms:
  - os: OS X
    osVersion: Big Sur
    browserName: Chrome
    browserVersion: latest
  - os: Windows
    osVersion: 10
    browserName: Edge
    browserVersion: latest
  - deviceName: Samsung Galaxy S22 Ultra
    browserName: chrome # Try 'samsung' for Samsung browser
    osVersion: 12.0

# =======================
# Parallels per Platform
# =======================
# The number of parallel threads to be used for each platform set.
# BrowserStack's SDK runner will select the best strategy based on the configured value
#
# Example 1 - If you have configured 3 platforms and set `parallelsPerPlatform` as 2, a total of 6 (2 * 3) parallel threads will be used on BrowserStack
#
# Example 2 - If you have configured 1 platform and set `parallelsPerPlatform` as 5, a total of 5 (1 * 5) parallel threads will be used on BrowserStack
parallelsPerPlatform: 1

# ==========================================
# BrowserStack Local
# (For localhost, staging/private websites)
# ==========================================
# Set browserStackLocal to true if your website under test is not accessible publicly over the internet
# Learn more about how BrowserStack Local works here -> https://www.browserstack.com/docs/automate/selenium/local-testing-introduction
browserstackLocal: true # <boolean> (Default false)
# browserStackLocalOptions:
# Options to be passed to BrowserStack local in-case of advanced configurations
# localIdentifier: # <string> (Default: null) Needed if you need to run multiple instances of local.
# forceLocal: true  # <boolean> (Default: false) Set to true if you need to resolve all your traffic via BrowserStack Local tunnel.
# Entire list of arguments available here -> https://www.browserstack.com/docs/automate/selenium/manage-incoming-connections

# ===================
# Debugging features
# ===================
debug: true # <boolean> # Set to true if you need screenshots for every selenium command ran
networkLogs: false # <boolean> Set to true to enable HAR logs capturing
consoleLogs: verbose # <string> Remote browser's console debug levels to be printed (Default: errors)
# Available options are `disable`, `errors`, `warnings`, `info`, `verbose` (Default: errors)
# CUSTOM_TAG_<INT>: # <string> (Default: parent folder name of the test file) Custom tag for your test suite

# Test Observability is an intelligent test reporting & debugging product. It collects data using the SDK. Read more about what data is collected at https://www.browserstack.com/docs/test-observability/references/terms-and-conditions
# Visit observability.browserstack.com to see your test reports and insights. To disable test observability, specify `testObservability: false` in the key below.
testObservability: true

Basically, is the one in the docs with my credentials.

The command i m trying to run is:

npx browserstack-node-sdk jest

Am i missing something?
Thanks for help,

Elia

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions