Giter Club home page Giter Club logo

Comments (4)

christian-bromann avatar christian-bromann commented on August 30, 2024 2

Sure, let's say you have:

   {
        "short_version": "13",
        "long_name": "Safari",
        "api_name": "safari",
        "long_version": "13.1.",
        "latest_stable_version": "",
        "automation_backend": "webdriver",
        "os": "Mac 10.15"
    }

If you would use WebdriverIO you could do:

import { remote } from 'webdriverio'

const platform = { ... } // see above

;(async function () => {
    const browser = remote({
        user: process.env.SAUCE_USERNAME,
        key: process.env.SAUCE_ACCESS_KEY,
        capabilities: {
            browserName: platform.api_name,
            platformName: platform.os,
            browserVersion: platform.long_version
        })
    })

    // ...
})().catch(console.error)

Would that make sense?

from node-saucelabs.

christian-bromann avatar christian-bromann commented on August 30, 2024

Hey @foolip,

you can use the listPlatforms command, e.g.:

$ sl listPlatforms webdriver

or

const api = new SauceLabs()
const platforms = await api.listPlatforms("webdriver")

Other platform options are selenium-rc, appium or all. We are working on improving the docs around all these API interfaces. Let me know if you have further questions.

from node-saucelabs.

foolip avatar foolip commented on August 30, 2024

Thanks @christian-bromann, I got that to work with your example, thanks!

I also found https://wiki.saucelabs.com/display/DOCS/Platform+Information+Methods for the underlying REST API.

I do have a follow-up question: given an entry from that long list of platforms, is there a reliable way of turning that into WebDriver capabilities for connecting to exactly that configuration? I'm not sure if I'm doing it right or if lax matching in some layer could lead to two browser versions being treated as the same. In particular I'm wondering about Safari 13 vs. 13.1, since both have the same short_version.

from node-saucelabs.

foolip avatar foolip commented on August 30, 2024

Thanks @christian-bromann, if passing along the values works that's great, and easier than I thought from trying to do something similar a few years ago. I'll give it another try :)

from node-saucelabs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.