Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caught error from Browsertime Error: Cannot find module ‘selenium-webdriver’ Require stack: #4249

Open
2 tasks done
KirubakaranK17 opened this issue Jul 31, 2024 · 3 comments
Labels

Comments

@KirubakaranK17
Copy link

Have you read the documentation?

URL

https://app-mirror.fourkites.com/

What are you trying to accomplish

When i was running with 34.9.0 version below error is getting displayed
docker run -v /home/ec2-user/workspace/frontend-performance:/sitespeed.io -w /sitespeed.io sitespeedio/sitespeed.io:34.9.0 --budget.configPath /sitespeed.io/fronend_performance_test/testdata/bugdet_file/ois/test_clickOnDashboard.json --multi /sitespeed.io/fronend_performance_test/testcase/ois/test_clickOnDashboard.js -b chrome --slug ois_test --graphite.host 127.0.0.1 --budget.suppressExitCode
Google Chrome 127.0.6533.72
Mozilla Firefox 128.0
Microsoft Edge 126.0.2592.113
[2024-07-31 13:42:49] INFO: Versions OS: linux 4.14.327-246.539.amzn2.x86_64 nodejs: v20.15.1 sitespeed.io: 34.9.0 browsertime: 22.8.0 coach: 8.0.2
[2024-07-31 13:42:49] ERROR: Caught error from Browsertime Error: Cannot find module 'selenium-webdriver'
Require stack:

  • /sitespeed.io/fronend_performance_test/testcase/ois/test_clickOnDashboard.js
    Require stack:
  • /sitespeed.io/fronend_performance_test/testcase/ois/test_clickOnDashboard.js

What browser did you use?

Chrome

How to reproduce

While running the docker run command itself

Log output

No response

@soulgalore
Copy link
Member

Hi @KirubakaranK17 , I'm having a hard time reproduce this, if you run a simplified version do that work? Can you try:

docker run --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:34.9.0 https://www.sitespeed.io/

@soulgalore
Copy link
Member

Could it be that in your script file try to import 'selenium-webdriver'?

@KirubakaranK17
Copy link
Author

yes i have mentioned the selenium-webdriver in the script file

const { By, until } = require('selenium-webdriver');

class CommandHandler {
constructor(driver, commands) {
this.driver = driver;
this.commands = commands;
}

async clickByXpathAndWait(xpath) {
await this.commands.click.byXpathAndWait(xpath);
}

async waitByTime(time) {
await this.commands.wait.byTime(time);
}

async addTextByName(name, text) {
let addTextLocator = await this.driver.findElement(By.name(name));
await addTextLocator.click();
await addTextLocator.sendKeys(text);
}

async navigate(url) {
await this.commands.navigate(url)
}

async waitByPageToComplete() {
await this.commands.wait.byPageToComplete();
}

async clickByName(name)
{
await this.driver.findElement(By.name(name)).click()
}

async clickById(Id)
{
await this.driver.findElement(By.Id(Id)).click()
}

async addTextByXpath(name, text) {
let enterValue = await this.driver.findElement(By.xpath(name));
enterValue.click();
enterValue.sendKeys(text);
}

async measureStart(name)
{
await this.commands.measure.start(name);
}

async measureStop(name)
{
await this.commands.measure.stop(name);
}

}

module.exports = CommandHandler;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants