Code Monkey home page Code Monkey logo

javiertuya / selema Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 508 KB

A multi-platform, multi-framework Selenium Test Lifecycle Manager on Java and .NET. Automates the WebDriver instantiation and configuration, providing an unified test log, clues for debugging and integration with CI platforms and Browser services

License: Apache License 2.0

Java 56.97% HTML 5.73% Batchfile 0.29% JavaScript 22.80% CSS 3.48% C# 10.33% Dockerfile 0.33% Shell 0.07%
selenium webdriver testing-tools lifecycle nunit mstest junit java netcore

selema's Introduction

selema's People

Contributors

dependabot[bot] avatar javiertuya avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

selema's Issues

Headless tests fail with Chrome driver version 111

Combined update (no selenium related) #206 fails.

Associated issues:

Follow up:

  • Workaround: add argument --remote-allow-origins=*
  • Local java driver: same as headless
  • NET platform: does not fail, but included the same test workaround (generated from java)
  • Selenoid:
    • Current container: aerokube/selenoid:1.10.9@sha256:b56d59210ffd7dadcb4272e503ad6d87f0c73a0c1d88cefd6e4dee8eb81f84d1 still with selenoid/vnc:chrome_110.0, ok
    • Upgrade to crhome 111, not affected
  • Wait for next selenium release (issue already fixed)

Regression: Headless mode failure on java, but not on .net

Appeared after some updates, not clear if it is related to these updates. Error message:

[TestDriver.testLocalWebDriverDefault: java/src/test/java/test4giis/selema/core/TestDriver.java#L53](https://github.com/javiertuya/selema/commit/752128787175ba8d0272f921f7059a5d15702dcc#annotation_2968909030)
Unable to establish websocket connection to http://localhost:49485/devtools/browser/35ca8ad0-33e4-4547-8ad7-1acacd3ae77c
Build info: version: '4.1.2', revision: '9a5a329c5a'
System info: host: 'fv-az135-704', ip: '10.1.0.148', os.name: 'Linux', os.arch: 'amd64', os.version: '5.11.0-1028-azure', java.version: '1.8.0_322'
Driver info: driver.version: TestDriver

Regression: All Java updates fail a test when reading log file

Failure trace is the same for all builds, at the first test

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running test4giis.selema.junit5.TestLifecycle5WithoutManager
Error:  Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.096 s <<< FAILURE! -- in test4giis.selema.junit5.TestLifecycle5WithoutManager
Error:  test4giis.selema.junit5.TestLifecycle5WithoutManager -- Time elapsed: 0.096 s <<< ERROR!
giis.portable.util.PortableException: Error reading file /home/runner/work/selema/selema/java/target/selema/selema-log.html
	at giis.portable.util.FileUtil.fileReadLines(FileUtil.java:54)
	at test4giis.selema.core.LogReader.getLogSize(LogReader.java:29)
	at test4giis.selema.junit5.TestLifecycle5WithoutManager.setUpClass(TestLifecycle5WithoutManager.java:22)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	Suppressed: giis.portable.util.PortableException: Error reading file /home/runner/work/selema/selema/java/target/selema/selema-log.html
		at giis.portable.util.FileUtil.fileReadLines(FileUtil.java:54)
		at test4giis.selema.core.LogReader.getLogSize(LogReader.java:29)
		at test4giis.selema.junit5.TestLifecycle5WithoutManager.afterTearDown(TestLifecycle5WithoutManager.java:35)
		at java.base/java.lang.reflect.Method.invoke(Method.java:566)
		at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
		at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085)
		... 1 more
	Caused by: java.nio.file.NoSuchFileException: /home/runner/work/selema/selema/java/target/selema/selema-log.html
		at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
		at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219)
		at java.base/java.nio.file.Files.newByteChannel(Files.java:371)
		at java.base/java.nio.file.Files.newByteChannel(Files.java:422)
		at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420)
		at java.base/java.nio.file.Files.newInputStream(Files.java:156)
		at java.base/java.nio.file.Files.newBufferedReader(Files.java:28[39](https://github.com/javiertuya/selema/actions/runs/6583512096/job/17886666891#step:10:40))
		at java.base/java.nio.file.Files.readAllLines(Files.java:3330)
		at org.apache.commons.io.FileUtils.readLines(FileUtils.java:2668)
		at org.apache.commons.io.FileUtils.readLines(FileUtils.java:2686)
		at giis.portable.util.FileUtil.fileReadLines(FileUtil.java:[52](https://github.com/javiertuya/selema/actions/runs/6583512096/job/17886666891#step:10:53))
		... 6 more

Regression: Test adding capabilities fails after update to selenium 4.9.0

PR #225 fails TestDriver.testHeadlessWebDriverWithOptions:

Caused by: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--headless, --remote-allow-origins=*], extensions: []}, key1: value1, key2: value2}]}]

Warning message at console:

PM org.openqa.selenium.remote.RemoteWebDriver checkNonW3CCapabilities
ADVERTENCIA: Support for Legacy Capabilities is deprecated; You are sending the following invalid capabilities: [key1, key2]; Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
Starting ChromeDriver 112.0.5615.49 (bd2a7bcb881c11e8cfe3078709382934e3916914-refs/branch-heads/5615@{#936}) on port 49042
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.

Although message is a warning, it seems that 4.9.0 removed legacy capabilities, so, key1 and key2 are illegal. See

https://www.selenium.dev/documentation/webdriver/getting_started/upgrade_to_selenium_4/#before

Using a prefix solves the problem (eg. test:key1), but if I want include a standard option in the map (eg: platformName:Windows 10), the driver instantiation/session fails. How can I set standard options like platformName in a generic way? (instead of using the options object setters)

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.