selenium-ide icon indicating copy to clipboard operation
selenium-ide copied to clipboard

Exported Javascript Mocha File Doesn't Run Cleanly

Open laikas123 opened this issue 2 years ago • 5 comments

🐛 Bug Report

A clear and concise description of what the bug is.

When exporting a test as JavaScript Mocha format, the code doesn't run when using mocha test

To Reproduce

Steps to reproduce the behavior:

Download this .side file:

bug.zip

Open in Selenium IDE

Export the test test2 as a JavaScript Mocha file.

Setup a mocha test directory e.g.

sudo npm install -g mocha
sudo npm install -g mocha-junit-reporter
sudo npm install selenium-webdriver
mkdir test

In the test directory place the exported JavaScript mocha test.

Run this in parent directory of test folder:

mocha test

You get the following error:

test2
       test2:
     TypeError: driver.actions(...).moveToElement is not a function
      at Context.<anonymous> (test/test3.js:21:46)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Expected behavior

The test should run without any bugs like this

Project file reproducing this issue (highly encouraged)

Already put this above but here it is again

bug.zip

Issues without a reproduction project are likely to stall.

Environment

OS: Ubuntu 22.04 Selenium IDE Version: 3.17.4 Selenium SIDE Runner Version: Not sure if I'm using this... Node version: 20.2.0 Browser: Firefox Browser Version: Using latest docker image e.g. selenium/node-firefox alongside selenium grid

laikas123 avatar Jun 17 '23 14:06 laikas123

Is this maybe due to the node version being too high?

laikas123 avatar Jun 17 '23 14:06 laikas123

Update I just tested on node version 14.21.3 and same issue

laikas123 avatar Jun 17 '23 14:06 laikas123

@laikas123 - My bet is that this is using v4 of the selenium api and the exported commands need to be updated from v3 -> v4

toddtarsi avatar Jun 18 '23 12:06 toddtarsi

@toddtarsi yep, I think you are definitely right. Thank you.

laikas123 avatar Jun 20 '23 14:06 laikas123

push, this is still an issue after more than a year

supidupicoder2 avatar Jul 22 '24 14:07 supidupicoder2