SeleniumHQ / selenium-ide

Open Source record and playback test automation for the web.
https://selenium.dev/selenium-ide/
Apache License 2.0
2.8k stars 762 forks source link

Exported Javascript Mocha File Doesn't Run Cleanly #1654

Open laikas123 opened 1 year ago

laikas123 commented 1 year ago

🐛 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 commented 1 year ago

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

laikas123 commented 1 year ago

Update I just tested on node version 14.21.3 and same issue

toddtarsi commented 1 year ago

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

laikas123 commented 1 year ago

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

supidupicoder2 commented 2 months ago

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