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

Help with a javascript website #614

Closed
vmsoriano opened this issue Mar 27, 2023 · 5 comments
Closed

Help with a javascript website #614

vmsoriano opened this issue Mar 27, 2023 · 5 comments

Comments

@vmsoriano
Copy link

OpenTest version number: 1.4.1

If I try to set up a web test against a website written in Angular, the test works perfectly, however if I do the same against a website that contains a javascript application, I only get a blank screen and the page doesn't load.

Selenium options:

Selenium options

selenium:
# seleniumServerUrl: http://127.0.0.1:9515
desiredCapabilities:
browserName: chrome
chromeOptions:
chromeDriverExePath: /usr/bin/chromedriver
chromeDriverExeArgs: [headless, start-maximized, disable-extensions, disable-dev-shm-usage, no-sandbox]
resolution: 1920x1080
edgeDriverExePath:
firefoxDriverExePath: C:/Selenium/geckodriver.exe
# firefoxDriverExeArgs: []
ieDriverExePath:
# ieDriverExeArgs: []
operaDriverExePath: C:/Selenium/operadriver.exe
safariDriverExePath: /usr/bin/safaridriver
systemProperties:
# property1: value1

@Keonik1
Copy link

Keonik1 commented Apr 20, 2023

@vmsoriano maybe it will help?
#604 (comment)

@vmsoriano
Copy link
Author

don't work for me, i think its a problem with bot detection, homepage return blank but in browser the page show correctly.

I need to configure selenium stealth, but i dont know how introduce this parameters in actor.yaml

options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)

@Keonik1
Copy link

Keonik1 commented Apr 28, 2023

@adrianth can you correct me
@vmsoriano
if i correct understood you are need add chromeExperimentalOptions to your actor: (syntax maybe incorrect, i doesnt know how correct convert yaml to java Map)

chromeDriverExePath: /usr/bin/chromedriver
chromeDriverExeArgs: [headless, start-maximized, disable-extensions, disable-dev-shm-usage, no-sandbox]
chromeExperimentalOptions: {"excludeSwitches": "enable-automation",  "useAutomationExtension": False}

or like this maybe:

chromeDriverExePath: /usr/bin/chromedriver
chromeDriverExeArgs: [headless, start-maximized, disable-extensions, disable-dev-shm-usage, no-sandbox]
chromeExperimentalOptions:
  excludeSwitches: enable-automation
  useAutomationExtension: False

link to source code:

if (config.hasProperty("selenium.chromeExperimentalOptions")) {
config.getMap("selenium.chromeExperimentalOptions").forEach((key, value) -> {
chromeOptions.setExperimentalOption(key.toString(), value);
});
}

source code screenshot:
image

@vmsoriano
Copy link
Author

I try it, but when i type a list on actor.yaml

Caused by: org.openqa.selenium.InvalidArgumentException: invalid argument: entry 0 of 'firstMatch' is invalid
from invalid argument: cannot parse capability: goog:chromeOptions
from invalid argument: cannot parse excludeSwitches
from invalid argument: must be a list
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'ecrlpa06', ip: '10.31.134.24', os.name: 'Linux', os.arch: 'amd64', os.version: '4.18.0-425.19.2.el8_7.x86_64', java.version: '11.0.19'

And my config file

# Selenium options
selenium:
    # seleniumServerUrl: http://127.0.0.1:9515
    desiredCapabilities:
        browserName: chrome
        chromeOptions:
    chromeDriverExePath: /usr/bin/chromedriver
    chromeDriverExeArgs: [headless, start-maximized, enable-javascript, disable-extensions, disable-dev-shm-usage, no-sandbox]
    chromeExperimentalOptions:
       excludeSwitches: enable-automation
       useAutomationExtension: False
    resolution: 1920x1080
    edgeDriverExePath:

@vmsoriano
Copy link
Author

I think i solve the problem but i only update chromedriver to version 113

Thanks all

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

No branches or pull requests

2 participants