I want to show which browser is being used in a series of tests, i.e., whether the browser is Chrome or Firefox.
I have:
def initialize(browser)
@browser = browser
$log.info("\n"+"#{browser}"+" Browser initialized")
end
It returns Watir:
<Watir::Browser:0x24553a5d286c4da2 url="https://url" title="page name">
Are there any ideas how to get it to return the browser name instead?
There is also method in Watir API, which also works in watir-classic:
browser.name # => chrome
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With