Coder Social home page Coder Social logo

shaka-project / generic-webdriver-server Goto Github PK

View Code? Open in Web Editor NEW
24.0 7.0 17.0 9.72 MB

A generic WebDriver server framework for use with Karma and Selenium, with backends for ChromeOS, Chromecast, Tizen, and Xbox One.

License: Apache License 2.0

JavaScript 71.77% HTML 2.58% Shell 8.03% Dockerfile 3.35% Java 9.74% C# 4.52%
selenium webdriver karma chromebook chromeos chromecast tizen testing testing-tools

generic-webdriver-server's Introduction

Generic WebDriver Server

A generic WebDriver server framework and base class, implementing the subset of the WebDriver protocol necessary for Karma.

  • Automate JavaScript tests on exotic devices!
  • Easily add new devices!
  • Integrate easily with Selenium grid!
  • Written for NodeJS and distributed via NPM!

Intended audience

  • Projects using something like Karma for testing with a Selenium grid
    • If your test runner uses WebDriver to point browsers back to a URL, this subset of the WebDriver protocol can expand your grid to new devices
  • Not for testing via WebDriver directly
    • If you use a WebDriver client directly in your tests, this probably won't help you
    • Does not support element interaction or script injection
    • Screenshots may be supported on certain platforms

Basic requirements

What devices are supported?

Out of the box, we provide backends for:

In addition, you'll need JAR files from the package generic-webdriver-server.

Chromium-based Edge

In addition to the backends we provide, you can also use this generic backend to support Chromium-based Edge in Selenium 3, in spite of Selenium's recent decision not to support it directly. For details on setup for Chromium-based Edge, see Edgium.md

How it works

See how-it-works.md for details.

Setup

See setup.md for details.

generic-webdriver-server's People

Contributors

altmas5 avatar dependabot[bot] avatar github-actions[bot] avatar joeyparrish avatar shaka-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

generic-webdriver-server's Issues

Consider merging the tunneling docs

Each backend has a separate document explaining how to set up and use SSH tunnels to talk to a device on another network. This is something we have had to do often for our own test lab, which is on a separate network from where we do our development.

However, most of the content in these tunneling docs is the same across the various Generic WebDriver Server backends. We should explore merging these docs and producing a general doc that covers all backends.

Tizen tools stopped working when Samsung distributor certs expired

In the last few days, the Tizen Studio SDK's built-in distributor certificates expired. It is unclear to me how these can be replaced.

With packages being signed by now-expired distributor certs, our lab's Tizen TV refuses to let us install the package. This means we can't use Tizen in our Selenium grid any more.

For now, we're disabling the device in our lab grid config, but this needs to be resolved so that we can maintain Tizen as a supported platform in Shaka Player.

Xbox One session shutdown & new session failing often

Shutdown frequently fails with:

15:29:54.787 INFO [ResultConfig.handle] - Executing: [delete session: 51487242-4db9-4e7f-b3e1-d6ddd1d94676])
DELETE /session/c03e4bac1a19dcf1a769cb6371bfe1f1 {}
Session ID c03e4bac1a19dcf1a769cb6371bfe1f1 released
Uninstalling app
15:30:29.094 INFO [ActiveSessions$1.onStop] - Removing session org.openqa.selenium.remote.server.InMemorySession@646227ce
DELETE /session/c03e4bac1a19dcf1a769cb6371bfe1f1 {}
GET /shutdown {}
15:30:38.655 INFO [OsProcess.destroy] - Unable to drain process streams. Ignoring but the exception being swallowed follows.
org.apache.commons.exec.ExecuteException: The stop timeout of 2000 ms was exceeded (Exit value: -559038737)
        at org.apache.commons.exec.PumpStreamHandler.stopThread(PumpStreamHandler.java:295)
[snip]
15:30:38.655 ERROR [OsProcess.destroy] - Unable to kill process java.lang.ProcessImpl@5eb2d927
Done
15:30:38.796 INFO [ResultConfig.handle] - Done: [delete session: 51487242-4db9-4e7f-b3e1-d6ddd1d94676]

It seems significant to me that it tries to shut down the session twice. Perhaps the first call takes too long, and it tries again.

Some of the time, after this happens, if we quickly try to start a new session, this will fail with:

https://hostname/api/taskmanager/app?appid=LONG_APP_ID => HTTP 400: {"ErrorMess
age":"Failed to launch the application.","ErrorCode":-2147024894}
    at IncomingMessage.<anonymous> (path\to\npm\node_modules\xbox-one-webdriver-server\xbox-one-utils.js:287:25)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (_stream_readable.js:1220:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  method: 'POST',
  url: 'https://hostname/api/taskmanager/app?appid=LONG_APP_ID',
  statusCode: 400,
  body: '{"ErrorMessage":"Failed to launch the application.","ErrorCode":-2147024894}'
}

I assume this is because the old session is still being shut down. In testing with the CLI, I found that building and installing the app to start a new session often takes ~25 seconds. Then shutting down and uninstalling the app could take as much as ~36 seconds.

Detect iframe errors in Chromecast receiver

Related to #7, in which we should better document the requirements for loading content into an iframe as we do in the Chromecast receiver, we should also be able to detect failures in the receiver and show some appropriate error message on the device instead of a blank screen.

For example, this currently results in a blank screen, because google.com prevents embedding in an iframe:

chromecast-webdriver-cli --hostname=chromecast-hostname --url=https://www.google.com/

Security Policy violation Binary Artifacts

This issue was automatically created by Allstar.

Security Policy Violation
Project is out of compliance with Binary Artifacts policy: binaries present in source code

Rule Description
Binary Artifacts are an increased security risk in your repository. Binary artifacts cannot be reviewed, allowing the introduction of possibly obsolete or maliciously subverted executables. For more information see the Security Scorecards Documentation for Binary Artifacts.

Remediation Steps
To remediate, remove the generated executable artifacts from the repository.

Artifacts Found

  • base/java/third_party/auto-common-0.8.jar
  • base/java/third_party/auto-service-1.0-rc4.jar
  • base/java/third_party/selenium-server-standalone-3.141.59.jar

Additional Information
This policy is drawn from Security Scorecards, which is a tool that scores a project's adherence to security best practices. You may wish to run a Scorecards scan directly on this repository for more details.


Allstar has been installed on all Google managed GitHub orgs. Policies are gradually being rolled out and enforced by the GOSST and OSPO teams. Learn more at http://go/allstar

This issue will auto resolve when the policy is in compliance.

Issue created by Allstar. See https://github.com/ossf/allstar/ for more information. For questions specific to the repository, please contact the owner or maintainer.

Docker won't mount Tizen app template on macOS

On macOS, Docker won't mount arbitrary paths. So we need to copy the Tizen app template into /tmp first.

docker: Error response from daemon: Mounts denied:
The path /usr/local/lib/node_modules/tizen-webdriver-server/app-template
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.

Clarify docs on Chromecast receiver deployment

There is no need to deploy a custom receiver app for the Chromecast backend. The process is documented for the following reasons:

  • in case anyone wants to own their own receiver app to avoid a dependency on github.io for critical infrastructure
  • in case anyone wants to make private customizations to the receiver
  • in the spirit of open source, to allow anyone to replicate what we've done

The docs, however, could make this clearer, so that users do not mistakenly assume that they must pay a Chromecast developer fee and deploy their own app to use this tool.

Document requirements for iframe embedding for Chromecast receiver

Sites can prevent iframe-embedding with the X-Frame-Options header. Though this should not be an issue for a test runner, one of the first things a person might try with the command-line tools is:

chromecast-webdriver-cli --hostname=chromecast-hostname --url=https://www.google.com/

However, google.com prevents iframe embedding, which means it cannot be shown in our Chromecast receiver. The user would see a blank screen instead. This should be clearly documented to avoid confusion.

Security Policy violation Binary Artifacts

This issue was automatically created by Allstar.

Security Policy Violation
Project is out of compliance with Binary Artifacts policy: binaries present in source code

Rule Description
Binary Artifacts are an increased security risk in your repository. Binary artifacts cannot be reviewed, allowing the introduction of possibly obsolete or maliciously subverted executables. For more information see the Security Scorecards Documentation for Binary Artifacts.

Remediation Steps
To remediate, remove the generated executable artifacts from the repository.

Artifacts Found

  • base/java/third_party/auto-common-0.8.jar
  • base/java/third_party/auto-service-1.0-rc4.jar
  • base/java/third_party/selenium-server-standalone-3.141.59.jar

Additional Information
This policy is drawn from Security Scorecards, which is a tool that scores a project's adherence to security best practices. You may wish to run a Scorecards scan directly on this repository for more details.


Allstar has been installed on all Google managed GitHub orgs. Policies are gradually being rolled out and enforced by the GOSST and OSPO teams. Learn more at http://go/allstar

This issue will auto resolve when the policy is in compliance.

Issue created by Allstar. See https://github.com/ossf/allstar/ for more information. For questions specific to the repository, please contact the owner or maintainer.

Does this support webdriverio with appium?

HI there,

I've been trying to get this to work with WDIO and Appium and get the following error messages on the node

Session ID df2ab128dc932a04cb96614c3ef2a5d6 created
12:02:03.519 INFO [ProtocolHandshake.createSession] - Detected dialect: W3C
12:02:04.120 INFO [ResultConfig.handle] - Executing: [find element: By.cssSelector: [data-test-id="5"]])
POST /session/df2ab128dc932a04cb96614c3ef2a5d6/element { value: '[data-test-id="5"]', using: 'css selector' }
12:02:04.169 ERROR [FindElement.call] - Unexpected exception during findElement
org.openqa.selenium.UnsupportedCommandException: An unknown error has occurred
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'UKC02QK85KG8WN', ip: 'fe80:0:0:0:c8d:a184:cc6f:263c%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '12.0.1'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities {javascriptEnabled: true, platform: ANY, platformName: ANY}
Session ID: df2ab128dc932a04cb96614c3ef2a5d6
*** Element info: {Using=css selector, value=[data-test-id="5"]}
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
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.findElementByCssSelector(RemoteWebDriver.java:420)
at org.openqa.selenium.By$ByCssSelector.findElement(By.java:431)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:315)
at org.openqa.selenium.remote.server.handler.FindElement.call(FindElement.java:49)
at org.openqa.selenium.remote.server.handler.FindElement.call(FindElement.java:32)
at org.openqa.selenium.remote.server.handler.WebDriverHandler.handle(WebDriverHandler.java:41)
at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:125)
at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:200)
at org.openqa.selenium.remote.server.InMemorySession.execute(InMemorySession.java:84)
at org.openqa.selenium.remote.server.WebDriverServlet.lambda$handle$0(WebDriverServlet.java:235)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:835)

My setup for the node is

java \
  -Dgenericwebdriver.browser.name=tizen \
  -Dgenericwebdriver.backend.exe=node_modules/tizen-webdriver-server/tizen-webdriver-server.js\
  -Dgenericwebdriver.backend.params.hostname=192.168.0.26:26101\
  -Dgenericwebdriver.backend.params.local-tizen-studio=true\
  -Dgenericwebdriver.backend.params.wake-on-lan-address=true\
  -Dgenericwebdriver.backend.params.tizen-studio-path=../../../../../../tizen-studio\
  -Dgenericwebdriver.backend.params.tizen-studio-author-profile=dkh10\
  -cp node_modules/generic-webdriver-server/GenericWebDriverProvider.jar:node_modules/generic-webdriver-server/selenium-server-standalone-3.141.59.jar \
  org.openqa.grid.selenium.GridLauncherV3 \.

(The same thing occurs if I use i remove local-tizen studio, tizen-studio-path, tizen-studio-author-profile

The wdio config i use is

 services: [
    [
      [
        'appium',
        {
          logPath: './',
          command: 'appium',
          args: {
            // ...
            'show-config': true,
            debugLogSpacing: true,
            platformName: 'tizen',
            deviceName: 'smarttv',
            port: '5555',
            'bootstrap-port': '5555',
            // ...
          },
        },
      ],
    ],
  ],
  capabilities: [
    {
      browserName: 'tizen',
      port: 5555,
    },
  ]

Thank you for reading this, I hope there is a way, that would be pretty awesome :)

Security Policy violation Binary Artifacts

This issue was automatically created by Allstar.

Security Policy Violation
Project is out of compliance with Binary Artifacts policy: binaries present in source code

Rule Description
Binary Artifacts are an increased security risk in your repository. Binary artifacts cannot be reviewed, allowing the introduction of possibly obsolete or maliciously subverted executables. For more information see the Security Scorecards Documentation for Binary Artifacts.

Remediation Steps
To remediate, remove the generated executable artifacts from the repository.

Artifacts Found

  • base/java/third_party/auto-common-0.8.jar
  • base/java/third_party/auto-service-1.0-rc4.jar
  • base/java/third_party/selenium-server-standalone-3.141.59.jar

Additional Information
This policy is drawn from Security Scorecards, which is a tool that scores a project's adherence to security best practices. You may wish to run a Scorecards scan directly on this repository for more details.


Allstar has been installed on all Google managed GitHub orgs. Policies are gradually being rolled out and enforced by the GOSST and OSPO teams. Learn more at http://go/allstar

This issue will auto resolve when the policy is in compliance.

Issue created by Allstar. See https://github.com/ossf/allstar/ for more information. For questions specific to the repository, please contact the owner or maintainer.

Add tests beyond linting

Neither the base package nor any of the backends have unit or integration tests. The only thing even approaching testing is the use of eslint.

We need to decide the best way to test our testing tools.

[Tizen] Option to use wake-on-lan to wake up the device

In some cases, the Tizen device goes to sleep while idle, and needs to be woken up for testing. Ideally, there would be an option in the Tizen server and command line tools that would allow the user to specify the ethernet address of the device and wake it when it doesn't respond to pings right away.

Chromecast driver - receiver not found

The Chromecast driver seems to have stopped working:

(node:5795) UnhandledPromiseRejectionWarning: Error: Failed to launch receiver!  Reason: NOT_FOUND
    at Channel.receiver.on (/usr/local/lib/node_modules/chromecast-webdriver-server/cast-utils.js:122:18)

Security Policy violation Binary Artifacts

This issue was automatically created by Allstar.

Security Policy Violation
Project is out of compliance with Binary Artifacts policy: binaries present in source code

Rule Description
Binary Artifacts are an increased security risk in your repository. Binary artifacts cannot be reviewed, allowing the introduction of possibly obsolete or maliciously subverted executables. For more information see the Security Scorecards Documentation for Binary Artifacts.

Remediation Steps
To remediate, remove the generated executable artifacts from the repository.

Artifacts Found

  • base/java/third_party/auto-common-0.8.jar
  • base/java/third_party/auto-service-1.0-rc4.jar
  • base/java/third_party/selenium-server-standalone-3.141.59.jar

Additional Information
This policy is drawn from Security Scorecards, which is a tool that scores a project's adherence to security best practices. You may wish to run a Scorecards scan directly on this repository for more details.


Allstar has been installed on all Google managed GitHub orgs. Policies are gradually being rolled out and enforced by the GOSST and OSPO teams. Learn more at http://go/allstar

This issue will auto resolve when the policy is in compliance.

Issue created by Allstar. See https://github.com/ossf/allstar/ for more information. For questions specific to the repository, please contact the owner or maintainer.

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.