Pergunta

I am trying to run through a simple tutorial on how to use selenium webdriver. The following code works fine when the test passes but when I have the assert.equal fail I get a urgly error message in my shell.

enter image description here

var assert = require('assert'),
test = require('selenium-webdriver/testing'),
webdriver = require('selenium-webdriver');

test.describe('Google Search', function() {
  test.it('should work', function() {

    var driver = new webdriver.Builder().withCapabilities(webdriver.Capabilities.chrome()).build();

    driver.get('http://www.yahoo.com');
    var searchBox = driver.findElement(webdriver.By.name('p'));
    searchBox.sendKeys('simple programmer');

    searchBox.getAttribute('value').then(function(value) {
      assert.equal(value, 'simple programmer');
    });

    driver.quit();  
  });

});
Foi útil?

Solução

I have solved this problem by completely re installing node.js. After re installing express installed just fine.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top