Created
June 26, 2021 01:10
-
-
Save Jaimin180296/e09d5ff8cd6a9238ab289a22e981934c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'watir' | |
caps = { | |
browserName: 'Chrome', | |
browserVersion: '91', | |
url: 'https://<username>:<accesskey>@hub-use.browserstack.com/wd/hub', | |
acceptInsecureCerts: true, | |
resolution: '1920x1080', | |
projectName: 'Console_Logs_Debug', | |
buildName: 'Chrome_Console_Logs_Debug', | |
sessionName: '[DEBUG] : Chrome console logs issue', | |
local: false, | |
debug: true, | |
chromeOptions: {w3c: false}, | |
consoleLogs: 'verbose', | |
networkLogs: false, | |
idleTimeout: 150, | |
os: 'Windows' | |
} | |
browser = Watir::Browser.new :chrome, capabilities: caps, url: caps[:url] | |
browser.goto 'https://www.massmutual.com' | |
browser.execute_script('document.cookie="utagdb=true";') | |
puts 'I ran the command "document.cookie="utagdb=true";" in browser console' | |
browser.refresh; sleep 5 | |
puts 'I refreshed the browser window' | |
console_logs = browser.driver.manage.logs.get(:browser) | |
puts console_logs | |
browser.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment