Using Selenium Webdriver with Javascript Gauge

257 views
Skip to first unread message

jose...@vibenomics.com

unread,
Dec 11, 2017, 2:48:56 PM12/11/17
to getgauge
Hello,

Very new to Gauge. I am trying to use the Selenium Webdriver with the js plugin. It appears to be able to build a webdriver (and gives an error if it is built incorrectly, like using a browser that doesn't exist), but all the commands to it like get, wait, etc. do nothing.

As a simple test, initialize gauge with js and add the following to the end of the step implementation file:

var webdriver = require('selenium-webdriver'),
  By = require('selenium-webdriver').By,
  until = require('selenium-webdriver').until;

var driver = new webdriver.Builder().forBrowser('chrome').build();

driver.get('https://www.google.com');


Run it and it will merely open the browser, not go to google. Remove the Gauge aspects of the implementation file (the steps and the hooks), run it with node, and it works fine.

I have chromedriver 2.33 in my path but this happens with all other browsers I tried as well.

How do I avoid this? I am using Gauge 0.9.5 and 2.0.2 of the js plugin.




Kashish Munjal

unread,
Dec 12, 2017, 12:16:17 AM12/12/17
to getg...@googlegroups.com
Hey,

The following step implementation hits the given url and exits.

Step implementation

const webdriver = require('selenium-webdriver'),
By = require('selenium-webdriver').By,
until = require('selenium-webdriver').until;
let driver;

beforeSuite(async () => driver = new webdriver.Builder().forBrowser('chrome').build());

afterSuite(async () => driver.close());

step("Go to <query>", async query => driver.get(query));


Specification

Getting Started with Gauge
==========================
Get Started
-----------

Have a look at this js template project which uses wedriverio to control the browser.

--
You received this message because you are subscribed to the Google Groups "getgauge" group.
To unsubscribe from this group and stop receiving emails from it, send an email to getgauge+unsubscribe@googlegroups.com.
To post to this group, send email to getg...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/getgauge/7997c7bf-9bc6-4acf-800c-361cd74f8dd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Thanks,
Kashish Munjal
Reply all
Reply to author
Forward
0 new messages