Giter Site home page Giter Site logo

selenide-browserstack's Introduction

selenide-browserstack

Selenide Integration with BrowserStack.

BrowserStack Logo

Setup

Running your tests

  • To run a parallel tests, run mvn test -P sample-test
  • To run local tests, run mvn test -P sample-local-test
  • To run a full suite of tests with Cross-browser Testing, run mvn test -P suite

Understand how many parallel sessions you need by using our Parallel Test Calculator

Notes

  • You can view your test results on the BrowserStack Automate dashboard

  • To test on a different set of browsers, check out our platform configurator

  • You can export the environment variables for the Username and Access Key of your BrowserStack account

    export BROWSERSTACK_USERNAME=<browserstack-username> &&
    export BROWSERSTACK_ACCESS_KEY=<browserstack-access-key>
    

selenide-browserstack's People

Contributors

07souravkunda avatar agarneha1331 avatar ankit098 avatar bstack-security-github avatar francisf avatar kamal-kaur04 avatar karanshah-browserstack avatar mohitmun avatar mukulbstack avatar nimit95 avatar philippfr avatar rhlbhatnagar avatar shirish87 avatar shwetashetye avatar sinstein avatar vikas17a avatar yashdsaraf avatar

Stargazers

 avatar  avatar  avatar

Watchers

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

selenide-browserstack's Issues

Browserstack session not ended correctly with the code provided

The code provided in this sample, didn't work for me correctly: when the test ended, BrowserStack session didn't end, and it finished after several minutes with timeout.
The recommended code is:

	@AfterMethod(alwaysRun=true)
	public void tearDown() throws Exception {
		WebDriverRunner.closeWebDriver();
		if (l != null) l.stop();
}

But after investigation I found out the following code was running:

com.codeborne.selenide.drivercommands.WebDriverWrapper#close
  /**
   * Does not close webdriver.
   * This class holds a webdriver created by user - in this case user is responsible for closing webdriver by himself.
   */
  @Override
  public void close() {
  }

So, after I replaced "WebDriverRunner.closeWebDriver();" with "WebDriverRunner.getWebDriver().quit();", Browserstack session was ended correctly.

It looks like this sample needs to be updated, unless it's something wrong with my code.
Libraries used: Selenide:5.2.3, cucumber-junit:4.3.1

Error HTTP ERROR 500 java.io.IOException: java.lang.NoClassDefFoundError: Could not initialize class org.openqa.selenium.remote.server.NewSessionPayload

When I am trying to run test locally I am getting an Error

`/usr/lib/jvm/java-8-openjdk-amd64/bin/java -Dmaven.multiModuleProjectDirectory=/home/xxx/repos/selenium-tests/xxx-tests -Dmaven.home=/home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3757.29/plugins/maven/lib/maven3 -Dclassworlds.conf=/home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3757.29/plugins/maven/lib/maven3/bin/m2.conf -javaagent:/home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3757.29/lib/idea_rt.jar=46843:/home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3757.29/bin -Dfile.encoding=UTF-8 -classpath /home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3757.29/plugins/maven/lib/maven3/boot/plexus-classworlds-2.5.2.jar org.codehaus.classworlds.Launcher -Didea.version=2017.2.2 clean test -P local
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.xxx:xxxTests:jar:4.0.0
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: io.github.bonigarcia:webdrivermanager:jar -> version 1.7.1 vs 1.7.0 @ line 95, column 17
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xxxTests 4.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ xxxTests ---
[INFO] Deleting /home/xxx/repos/selenium-tests/xxx-tests/target
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ xxxTests ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ xxxTests ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 9 source files to /home/xxx/repos/selenium-tests/xxx-tests/target/classes
[INFO] /home/xxx/repos/selenium-tests/xxx-tests/src/main/java/webdriver/WebDriverFactory.java: /home/xxx/repos/selenium-tests/xxx-tests/src/main/java/webdriver/WebDriverFactory.java uses unchecked or unsafe operations.
[INFO] /home/xxx/repos/selenium-tests/xxx-tests/src/main/java/webdriver/WebDriverFactory.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ xxxTests ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ xxxTests ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 14 source files to /home/xxx/repos/selenium-tests/xxx-tests/target/test-classes
[INFO] /home/xxx/repos/selenium-tests/xxx-tests/src/test/java/com/xxx/TestNgTestBase.java: Some input files use unchecked or unsafe operations.
[INFO] /home/xxx/repos/selenium-tests/xxx-tests/src/test/java/com/xxx/TestNgTestBase.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- automate-maven-plugin:0.7.2-SNAPSHOT:test-compile (default) @ xxxTests ---
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ xxxTests ---
[INFO] Surefire report directory: /home/xxx/repos/selenium-tests/xxx-tests/target/surefire-reports


T E S T S

Running TestSuite
...
... TestNG 6.11 by Cédric Beust ([email protected])
...

15:23:05.361 INFO com.xxx.friendly_iframes.script_inside.FriendlyIframeTest -> Running tests on environment chrome
Tests run: 45, Failures: 1, Errors: 0, Skipped: 44, Time elapsed: 1.273 sec <<< FAILURE! - in TestSuite
setUp(com.xxx.friendly_iframes.script_inside.FriendlyIframeTest) Time elapsed: 1.123 sec <<< FAILURE!
org.openqa.selenium.WebDriverException: Unable to parse remote response:

<title>Error 500 Server Error</title>

HTTP ERROR 500

Problem accessing /wd/hub/session. Reason:

    Server Error

Caused by:

java.io.IOException: java.lang.NoClassDefFoundError: Could not initialize class org.openqa.selenium.remote.server.NewSessionPayload
	at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:135)
	at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:68)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:841)
	at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
	at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
	at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.seleniumhq.jetty9.server.Server.handle(Server.java:564)
	at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:317)
	at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:251)
	at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
	at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:110)
	at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
	at org.seleniumhq.jetty9.util.thread.Invocable.invokePreferred(Invocable.java:128)
	at org.seleniumhq.jetty9.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.openqa.selenium.remote.server.NewSessionPayload
	at org.openqa.grid.web.servlet.handler.WebDriverRequest.extractDesiredCapability(WebDriverRequest.java:70)
	at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.<init>(SeleniumBasedRequest.java:102)
	at org.openqa.grid.web.servlet.handler.WebDriverRequest.<init>(WebDriverRequest.java:40)
	at org.openqa.grid.web.servlet.handler.WebDriverRequestFactory.createFromRequest(WebDriverRequestFactory.java:30)
	at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.createFromRequest(SeleniumBasedRequest.java:73)
	at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:82)
	... 29 more

Caused by:

java.lang.NoClassDefFoundError: Could not initialize class org.openqa.selenium.remote.server.NewSessionPayload
	at org.openqa.grid.web.servlet.handler.WebDriverRequest.extractDesiredCapability(WebDriverRequest.java:70)
	at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.<init>(SeleniumBasedRequest.java:102)
	at org.openqa.grid.web.servlet.handler.WebDriverRequest.<init>(WebDriverRequest.java:40)
	at org.openqa.grid.web.servlet.handler.WebDriverRequestFactory.createFromRequest(WebDriverRequestFactory.java:30)
	at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.createFromRequest(SeleniumBasedRequest.java:73)
	at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:82)
	at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:68)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:841)
	at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
	at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
	at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.seleniumhq.jetty9.server.Server.handle(Server.java:564)
	at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:317)
	at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:251)
	at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
	at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:110)
	at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
	at org.seleniumhq.jetty9.util.thread.Invocable.invokePreferred(Invocable.java:128)
	at org.seleniumhq.jetty9.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
	at java.lang.Thread.run(Thread.java:748)

Powered by Jetty:// 9.4.5.v20170502

Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'NB0022', ip: '172.20.3.231', os.name: 'Linux', os.arch: 'amd64', os.version: '4.10.0-32-generic', java.version: '1.8.0_131'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:353)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:159)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:137)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:174)
at webdriver.WebDriverFactory.getInstance(WebDriverFactory.java:127)
at com.xxx.TestNgTestBase.setUp(TestNgTestBase.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
at org.testng.TestRunner.privateRun(TestRunner.java:744)
at org.testng.TestRunner.run(TestRunner.java:602)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:39)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:414)
at org.testng.internal.thread.ThreadUtil$1.call(ThreadUtil.java:52)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Results :

Failed tests:
FriendlyIframeTest>TestNgTestBase.setUp:72 » WebDriver Unable to parse remote ...

Tests run: 33, Failures: 1, Errors: 0, Skipped: 32

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.830 s
[INFO] Finished at: 2017-08-15T15:23:05+02:00
[INFO] Final Memory: 34M/472M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project xxxTests: There are test failures.
[ERROR]
[ERROR] Please refer to /home/xxx/repos/selenium-tests/xxx-tests/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Process finished with exit code 1
`

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.