mercredi 20 juin 2018

selenium-webdriver won't execute next step after opening browser

I've been trying to automate our web testing by using cucumber-js and selenium-webdriver. I wrote an example of simple web navigation, but I always get blank page and the runner stopped doing anything. Here is the code piece:

const { Given, When, Then } = require('cucumber')
const { assert, expect } = require('chai')
const webdriver = require('selenium-webdriver')

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

Given("I'm on landing page", function() {
    browser.get('https://www.google.com')
    browser.quit()
});

After I run the test with ./node_modules/.bin/cucumber-js what I get is always blank page either on chrome or firefox.

This is what I got after running the test

Does anybody experiencing the same issue? Any idea how to solve or at least debug this?

P.S. I'm using Chrome 65, and chromedriver 2.40.565383, Firefox 56 and geckodriver 0.21.0 running on 64-bit ubuntu 14.04

Any help would be appreciated! thanks!!

Aucun commentaire:

Enregistrer un commentaire