Strange error using Taurus and Selenium with Blazemeter

167 views
Skip to first unread message

Jonathan

unread,
Apr 25, 2017, 5:27:15 AM4/25/17
to codename-taurus

Hi,

I've been looking into using Blazemeter to run Selenium scripts with Taurus, however, I am having some trouble.
I've been trying to use the Taurus example "mocha_example.js" and "mocha_example.yml" from the Taurus git, however when I upload these to BlazeMeter using create taurus test, I get a response that looks like the following:














Does anybody have any idea why this occurs and what could be done to fix it.

The files I am using are below:
mocha_example.yml
---
execution:
- executor: selenium
  iterations: 10
  scenario:
    script: mocha_example.js


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

var driver;

test.describe('Blazedemo verification', function() {
    this.timeout(30000);

    test.before(function () {
        driver = new webdriver.Builder().
            withCapabilities(webdriver.Capabilities.chrome()).
            build();
    });

    test.after(function () {
        driver.quit();
    });

    test.it('selenium-mocha', function () {
        driver.get('http://blazedemo.com/');
        driver.getTitle().then(function (title) {
            assert.equal(title, 'BlazeDemo');
        });
    });

});


Andrey Pokhilko

unread,
Apr 25, 2017, 6:19:54 AM4/25/17
to codenam...@googlegroups.com

Hi,

There is Logs tab, which might contain remote bzt artifacts, with possible pointers in the log.


Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
BlazeMeter Inc.
--
You received this message because you are subscribed to the Google Groups "codename-taurus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codename-taur...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/20d44673-ef8e-4b4a-b443-7010526700e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jonathan

unread,
Apr 28, 2017, 5:15:40 AM4/28/17
to codename-taurus, andrey....@contractor.ca.com
Hi Andrey, 

Thanks for the tip, I've checked the artifacts-1.zip which was in the log screen you mentioned, and there was a mocha.err file inside with the contents below (This error was also in the bzt.log file too). It seems to be highlighting an issue with chrome. I've tried changing the driver in mocha_example.js to use firefox instead, but it still comes up with the same error about a problem with requiring chrome. Do you know why this could be occuring?


/home/jmeter/.bzt/selenium-taurus/mocha/node_modules/selenium-webdriver/index.js:25
const chrome = require('./chrome');
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/tmp/taurus/2017-04-28_09-00-59.tmpfo87Vi/mocha_example.js:2:17)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)


Thanks
Jonathan

Andrey Pokhilko

unread,
Apr 28, 2017, 5:54:25 AM4/28/17
to codenam...@googlegroups.com

No, the issue is version of NodeJS you have. Look here for example: http://stackoverflow.com/questions/22603078/syntaxerror-use-of-const-in-strict-mode

Try using latest version of NodeJS


Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
BlazeMeter Inc.

Jonathan

unread,
May 3, 2017, 5:34:17 AM5/3/17
to codename-taurus, andrey....@contractor.ca.com
Hi Andrey,

I have tried playing around, and have got the latest version of NodeJS on my local machine and it works great running with Taurus on there.
The problem only occurs now when trying to run in the cloud using BlazeMeter. Is there anything I can do about this, or will this only work on my local machine?

Thank you for all your help you've given me with this.

Andrey Pokhilko

unread,
May 4, 2017, 5:58:52 AM5/4/17
to Jonathan, codename-taurus

You should address BlazeMeter's issue to their sup...@blazemeter.com


Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
BlazeMeter Inc.
Reply all
Reply to author
Forward
0 new messages