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

Implement method to retrieve logs for Chrome #44

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mamantoha
Copy link
Contributor

@mamantoha mamantoha commented Feb 29, 2024

Usage example:

require "../src/selenium"

service = Selenium::Service.chrome(driver_path: "/usr/bin/chromedriver")
driver = Selenium::Driver.for(:chrome, service: service)
capabilities = Selenium::Chrome::Capabilities.new
capabilities.chrome_options.args = ["no-sandbox", "headless", "disable-gpu"]
capabilities.logging_prefs = {"browser" => "ALL"}

session = driver.create_session(capabilities)

session.navigate_to("https://alerts.in.ua")

wait = Selenium::Helpers::Wait.new(timeout: 5.seconds, interval: 1.second)

# wait for console.log("loaded map") to be called
wait.until do
  session.log("browser").any? &.message.ends_with?("\"loaded map\"")
end

# ...

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

Successfully merging this pull request may close these issues.

None yet

1 participant