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

How to use browser Edge or chorme ? #3225

Open
jecardenasri01 opened this issue Aug 15, 2023 · 3 comments
Open

How to use browser Edge or chorme ? #3225

jecardenasri01 opened this issue Aug 15, 2023 · 3 comments
Labels

Comments

@jecardenasri01
Copy link

Hi experts.
My serenity confi failed to execute browser microsoft edge , but i cant undestand this failed
Only executed correctly whit driver = "chrome"


{
drivers {
windows {
webdriver.chrome.driver = src/test/resources/webdriver/chromedriver.exe
webdriver.gecko.driver = src/test/resources/webdriver/geckodriver.exe
webdriver.ie.driver = src/test/resources/webdriver/msedgedriver.exe
}
}

webdriver {
driver = "edge"
autodownload = true

timeouts {
  script = 15000
  pageLoad = 15000
  implicit = 15000
}

capabilities {
  browserName = "MicrosoftEdge"
  "ms:edgeOptions" {
    args = [
      "remote-allow-origins=*",
      "ignore-certificate-errors",
      "start-maximized",
      "incognito"
    ]
  }
},
capabilities {
  browserName = "chrome"
  "goog:chromeOptions" {
    args = [
      "remote-allow-origins=*",
      "ignore-certificate-errors",
      "start-maximized",
      "incognito"
    ]
  }
}

}
}


image

Caused by: net.thucydides.core.webdriver.DriverConfigurationError
WebDriver was unable to create a new instance of type class org.openqa.selenium.edge.EdgeDriver
WebDriver reported the following message: Could not start a new session. Response code 500. Message: session not created: No matching capabilities found
Host info: host: 'IMAGEMAKER-PC', ip: '192.168.10.81'
Build info: version: '4.10.0', revision: 'c14d967899'
System info: os.name: 'Windows 11', os.arch: 'amd64', os.version: '10.0', java.version: '20.0.2'
Driver info: org.openqa.selenium.edge.EdgeDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: false, browserName: chrome, goog:chromeOptions: {args: [remote-allow-origins=, ignore-certificate-errors, start-maximized, incognito]}, ms:edgeOptions: {args: [ignore-certificate-errors, start-maximized, incognito, remote-allow-origins=, ignore-certificate-errors, start-maximized, incognito], extensions: []}}]}]
See below for more details.

@wakaleo
Copy link
Member

wakaleo commented Aug 15, 2023

You can only have one capabilities section. To support more than one brower, you need to use different environments sections.

@jecardenasri01
Copy link
Author

Solo puede tener una seccion de capacidades. Para admitir más de un navegador, debe usar diferentes secciones de entornos.

Hi.

could you give me an example? I really don't understand what to do.

In the documentation it shows only execution by 1 browser.

@wakaleo
Copy link
Member

wakaleo commented Aug 19, 2023

environments {
  chrome {
    webdriver {
      driver = chrome
      autodownload = true
      capabilities {
        browserName = "chrome"
        acceptInsecureCerts = true
        "goog:chromeOptions" {
          args = ["test-type", "ignore-certificate-errors", "headless", "--window-size=1000,800"
            "incognito", "disable-infobars", "disable-gpu", "disable-default-apps", "disable-popup-blocking"]
        }
      }
    }
  }
  edge {
    webdriver {
      capabilities {
        browserName = "MicrosoftEdge"
        "ms:edgeOptions" {
          args = ["test-type", "ignore-certificate-errors", "headless",
            "incognito", "disable-infobars", "disable-gpu", "disable-default-apps", "disable-popup-blocking"]
        }
      }
    }
  }
  firefox {
    webdriver {
      capabilities {
        browserName = "firefox"
        pageLoadStrategy = "normal"
        acceptInsecureCerts = true
        unhandledPromptBehavior = "dismiss"
        strictFileInteractability = true

        "moz:firefoxOptions" {
          args = ["-headless"],
          prefs {
            "javascript.options.showInConsole": false
          },
          log {"level": "info"},
        }
      }
    }
  }
}

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