Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to connect to remote Selenium server #235

Closed
wants to merge 2 commits into from
Closed

Conversation

tfga
Copy link

@tfga tfga commented Mar 31, 2014

Fixes issue #234.

The user still has to specify <serverHostname> for this to work, e.g.:

<remoteWebDriverUrl>http://seleniumServer:4444/wd/hub</remoteWebDriverUrl>
<serverHostname>localIpOrHostname</serverHostname>

@tfga tfga closed this Apr 1, 2014
@tfga tfga reopened this Apr 1, 2014
@tfga tfga changed the title Ability to connect to remote Selenium server (#234) Ability to connect to remote Selenium server Apr 3, 2014
@vmassol
Copy link

vmassol commented Sep 11, 2020

It would really be nice to support RemoteWebDriver in the jasmine maven plugin, as this would allow using docker to start the selenium/standalone-chrome docker image for chrome and have jasmin tests execute with it. This will avoid having to install the chrome headless binaries locally for example.

I find it nicer than using https://github.com/Ardesco/driver-binary-downloader-maven-plugin to get the webdriver.chrome.driver property in maven and pass it to the jasmine plugin.

This PR is from 2014 now. Starting to be quite old. Has any progress been made to support RemoteWebDriver?

I see in the sources the mention of RemoteWebDriver at

* <p>The <code>jasmine:test</code> goal to specify hostname where the server is running. Useful when using
but I couldn't find any example of using it.

Thanks for a great plugin!

@vmassol
Copy link

vmassol commented Sep 11, 2020

I find it nicer than using https://github.com/Ardesco/driver-binary-downloader-maven-plugin to get the webdriver.chrome.driver property in maven and pass it to the jasmine plugin.

Actually I see that the code is using WebDriverManager so that's a better solution and it doesn't need https://github.com/Ardesco/driver-binary-downloader-maven-plugin since it should do the binary download by itself.

I guess I need to try to see if RemoteWebDriver is supported but I see no reason why it couldn't be instantiated by WebDriverManager actually. So I guess it should work.

@vmassol
Copy link

vmassol commented Sep 11, 2020

Actually WebDriverManager will download the driver but not the browser. So the docker solution seems to be the only solution to not have to install anything locally (except doker ofc ;))

@searls
Copy link
Owner

searls commented Sep 12, 2020

Hi @vmassol. I haven't worked on this lib for years personally, but I hope @klieber might be available to comment on what level of maintenance he considers the library to be in and what he'd need to see in a feature request at this point

@klieber
Copy link
Collaborator

klieber commented Sep 13, 2020

Hi @vmassol @searls. Honestly I haven't really had time to work on this plugin in a long time and I haven't personally used it for any projects in about 6 - 7 years. I still do development in both javascript and java but there are just better ways to unit test javascript these days and all of it revolves around node / npm. Personally, when I have a maven based project now that also includes javascript I use the frontend-maven-plugin. That setup allows you to use node / npm for your javascript related stuff while still keeping the build as simple as running mvn install.

All that said, I think it's long overdo that I put a message on the README of this project stating that it is no longer being maintained and I will include my suggestions on alternative solutions.

@vmassol
Copy link

vmassol commented Sep 14, 2020

hey, thanks to both of you @searls & @klieber for your replies.

I still do development in both javascript and java but there are just better ways to unit test javascript these days and all of it revolves around node / npm. Personally, when I have a maven based project now that also includes javascript I use the frontend-maven-plugin. That setup allows you to use node / npm for your javascript related stuff while still keeping the build as simple as running mvn install.

I'm curious about this. We have some javascript to test and I fear that testing it on the server side (with node) would not ensure it'll work fine at runtime since it executes on the client side in our case (in FF or Chrome browsers). Also we don't use any Bower, Grunt, Gulp, Jspm, Karma, or Webpack as mentioned on https://github.com/eirslett/frontend-maven-plugin, so not sure it's the right solution in our case. Now I'm not the one who wrote this javascript and javascript is not my language of expertise (I'm a java guy) so maybe I'm just plain wrong. I'm just helping on the build side of XWiki here, trying to ensure that we can test our javascript through Maven and ideally that it doesn't require installing anything on the machine where it executes (except docker).

I'll check https://github.com/eirslett/frontend-maven-plugin a bit more to see if I don't miss something obvious. Feedback most welcome too ;)

Thanks guys

@klieber
Copy link
Collaborator

klieber commented Sep 14, 2020

When I post a message regarding this plugin no longer being maintained I plan to include some examples of how to use the frontend-maven-plugin in its place. That plugin will install node / npm automatically so no requirement to have that pre-installed.

@vmassol
Copy link

vmassol commented Sep 14, 2020

@klieber

That plugin will install node / mom automatically so no requirement to have that pre-installed.

Yes that's good but it'll still install something on the host machine! ;)

@tfga
Copy link
Author

tfga commented Sep 14, 2020

@vmassol
I've been using this since 2014 (had to publish my fork on the company repo under a different groupId). Never had any problems.

@klieber
Before declaring the project "officially dead", maybe you could merge the PRs (this and #236) and publish a final release? 🤔

@klieber
Copy link
Collaborator

klieber commented Sep 14, 2020

I will take a look at merging those but can't promise anything. I am planning on getting a stable 3.0 release with ChromeDriver out there before closing the door on it.

klieber added a commit to klieber/jasmine-maven-plugin that referenced this pull request Sep 16, 2020
klieber added a commit to klieber/jasmine-maven-plugin that referenced this pull request Sep 16, 2020
klieber added a commit to klieber/jasmine-maven-plugin that referenced this pull request Sep 16, 2020
Example usage:

```xml
<plugin>
  <groupId>com.github.searls</groupId>
  <artifactId>jasmine-maven-plugin</artifactId>
  <version>${jasmine-maven-plugin.version}</version>
  <executions>
    <execution>
      <goals>
        <goal>test</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <serverHostname>${accessibleHostname}</serverHostname>
    <webDriverClassName>org.openqa.selenium.remote.RemoteWebDriver</webDriverClassName>
    <webDriverCapabilities>
      <webDriverCapability>
        <name>browserName</name>
        <value>chrome</value>
      </webDriverCapability>
      <webDriverCapability>
        <name>goog:chromeOptions</name>
        <value implementation="org.openqa.selenium.chrome.ChromeOptions">
          <headless>true</headless>
        </value>
      </webDriverCapability>
    </webDriverCapabilities>
  </configuration>
</plugin>
```

closes searls#234
closes searls#235
closes searls#349
klieber added a commit to klieber/jasmine-maven-plugin that referenced this pull request Sep 16, 2020
Example usage:

```xml
<plugin>
  <groupId>com.github.searls</groupId>
  <artifactId>jasmine-maven-plugin</artifactId>
  <version>${jasmine-maven-plugin.version}</version>
  <executions>
    <execution>
      <goals>
        <goal>test</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <serverHostname>${accessibleHostname}</serverHostname>
    <webDriverClassName>org.openqa.selenium.remote.RemoteWebDriver</webDriverClassName>
    <webDriverCapabilities>
      <webDriverCapability>
        <name>browserName</name>
        <value>chrome</value>
      </webDriverCapability>
      <webDriverCapability>
        <name>goog:chromeOptions</name>
        <value implementation="org.openqa.selenium.chrome.ChromeOptions">
          <headless>true</headless>
        </value>
      </webDriverCapability>
    </webDriverCapabilities>
    <!-- If your remote server is not running at http://localhost:4444/wd/hub then you can use this parameter to configure the right location -->
    <!-- <remoteWebDriverUrl>http://localhost:4444/wd/hub</remoteWebDriverUrl> -->
  </configuration>
</plugin>
```

closes searls#234
closes searls#235
closes searls#349
@klieber klieber closed this in e288396 Sep 16, 2020
klieber added a commit to klieber/jasmine-maven-plugin that referenced this pull request Aug 24, 2022
Example usage:

```xml
<plugin>
  <groupId>com.github.searls</groupId>
  <artifactId>jasmine-maven-plugin</artifactId>
  <version>${jasmine-maven-plugin.version}</version>
  <executions>
    <execution>
      <goals>
        <goal>test</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <serverHostname>${accessibleHostname}</serverHostname>
    <webDriverClassName>org.openqa.selenium.remote.RemoteWebDriver</webDriverClassName>
    <webDriverCapabilities>
      <webDriverCapability>
        <name>browserName</name>
        <value>chrome</value>
      </webDriverCapability>
      <webDriverCapability>
        <name>goog:chromeOptions</name>
        <value implementation="org.openqa.selenium.chrome.ChromeOptions">
          <headless>true</headless>
        </value>
      </webDriverCapability>
    </webDriverCapabilities>
    <!-- If your remote server is not running at http://localhost:4444/wd/hub then you can use this parameter to configure the right location -->
    <!-- <remoteWebDriverUrl>http://localhost:4444/wd/hub</remoteWebDriverUrl> -->
  </configuration>
</plugin>
```

closes searls#234
closes searls#235
closes searls#349
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants