Finding Selenium SafariDriver Logs on Mac OSX

Has anyone had experience utilizing the Webdriver logs from Safaridriver on OSX? I am curious because despite configuring Safaridriver as shown below, I am unable to locate the logs in the specified directories such as '/User/${USER}', '/tmp', or '/var/log'.

SafariDriverService svc = new SafariDriverService.Builder()
    .withLogFile(new File("/tmp/safaridriver.log"))
    .usingAnyFreePort()
    .build();
new SafariDriver(svc, options);

Would anyone happen to know where Safaridriver bundled with Apple writes its logs?

I also attempted using RemoteWebDriver

SafariDriverService service = new SafariDriverService.Builder()
    .withLogFile(new File("/tmp/safaridriver.log"))
    .usingAnyFreePort()
    .build();

RemoteWebDriver.builder()
    .withDriverService(service)
    .url(webDriverUrl)
    .addAlternative(options)
    .build();

Appreciate any insights.

Answer №1

While working on my project, I incorporated SafariOptions in my code:

SafariOptions options = new SafariOptions();
options.setCapability("safari:diagnose", true);

This action generates logs in the directory

~/Library/Logs/com.apple.WebDriver/

If you need more information, you can refer to the documentation here

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Python - ExceptionalInputRequirement

I'm diving into the world of web scraping, but I keep running into roadblocks whenever I attempt to access a URL. Here's the code I'm working with: from selenium import webdriver from selenium.webdriver.common.keys import Keys driver = w ...

NodeJS and TypeScript are throwing an error with code TS2339, stating that the property 'timeOrigin' is not found on the type 'Performance'

I am currently working on a NodeJS/TypeScript application that utilizes Selenium WebDriver. Here is an excerpt from the code: import { WebDriver } from "selenium-webdriver"; export class MyClass { public async getTimeOrigin(driver: WebDriver ...

Selenium struggles with managing an extensive number of rows in a table

I'm currently working on a project that involves counting the number of tr elements in a table. I've stored the tr webElement in a list, but the code crashes when there are too many rows in the table, which can sometimes reach up to 100,000 rows. ...

What sets DesiredCapabilities and RequiredCapabilities apart from each other?

Could anyone provide some insight into the contrast between DesiredCapabilities and RequiredCapabilities when used in the RemoteWebDriver constructor? If you need more information on the constructor, you can refer to this link: ...

Why isn't the click function in Java Selenium working as expected?

What could be causing the issue with the click() function not working? Website: String startPage = "http://www.domiporta.pl/mieszkanie/sprzedam?Localization=dolno%C5%9Bl%C4%85skie&PageNumber=24&SortingOrder=InsertionDate"; Code: List<WebEle ...

What is the process for inspecting the element within a div using jsname with JS?

Struggling to inspect elements within a DIV without using xpath. // Assert.assertEquals("Digite uma senha",driver.findElement(By.xpath("//*[@id=\"view_container\"]/div/div/div[2]/div/div[1]/div/form/span/section/div/div/div[1]/div[2]/div[2] ...

How can one resolve the error message that says "WebDriverError: Connection refused"?

I am facing an issue with running Protractor tests on my local machine. A few days ago, everything was working fine but now I am unable to run the tests even after rebooting Ubuntu. Here are the versions of different components: $cat /etc/issue Ubuntu 14. ...

Could we identify a shared xpath for these elements?

The xpath for one element is: //div[@class='name-slider-header']//button//img[2] The xpath for another element is: //div[@class='name-slider-header']//button//img[1] My goal is to verify that the attribute of an element contains "red" ...

Locate element and perform a click action with VBA Selenium

I attempted to choose the highlighted Xpath in the image below and then proceeded to click on the element. Here is a snippet of the code I tried: On Error Resume Next Set Element = GC.FindElementByXPath("//*a[@data-id='_VIEW--ALL_COMPLAINTS_VIEW_P&ap ...

The functionality of hovering and clicking is not functioning as expected in Internet Explorer 11 when using Selenium Web

I'm experiencing difficulty in hovering and clicking on a submenu using IE 11 with Selenium. The code I am currently utilizing is as follows: Actions actions = new Actions(driver); actions.moveToElement(driver.findElement(By.xpath(Locator))).click(). ...

Troubleshooting issue with setting browser version using Selenium Add Additional Capability in .NET Framework not resolving

I am currently working on testing my program across various browser versions. To begin, I opted to use ChromeDriver by implementing the following code: using OpenQA.Selenium.Chrome; ChromeOptions Options = new ChromeOptions(); Options.PlatformName = " ...

Issue encountered during automation testing with Selenium in a TFS Build step due to errors in batch script execution

Step 1. After compiling selenium tests, I packaged them into an executable jar file. Step 2. When the jar is executed, the tests run smoothly. A new browser window opens and all steps are executed as expected. Step 3. To simplify the process, I created a ...

Finding an Element By ID proves to be a challenging task in Selenium

I am struggling to find the login ID using Selenium. I was able to make it work on a Windows computer previously, but now that I'm trying it at home on my Mac, I'm unable to locate the element by its ID. Even after implementing driverwait as sugg ...

Error encountered in Selenium while attempting to test the login functionality with Java: NoSuchElementException

Currently, I am following a Selenium testing framework tutorial by John Sonmez and encountered an issue while attempting to execute my very first test. The test involves two methods: 1. LoginPage.GoTo(); which opens the Wordpress login page and 2. LoginPag ...

Searching for elements in Selenium based on their ending values is a common task. Learn how to locate elements by

Currently, I am facing a situation where each time I log in, a report is presented in a table that has a randomly generated ID with text at the end which always includes "table". To automate this table using Selenium Python web driver, one option is to us ...

Can you provide the correct xpath syntax for utilizing the contains text function?

Can you review my xpath code below? By.xpath(".//div[contains(@class, 'foo123') and contains(text(), 'foo bar')]") I am attempting to locate the specified HTML element: <div class="foo123">foo bar</div> Do you see any er ...

Encountered an issue with passing arguments to the chrome driver while using Selenium

After using selenium to test my chrome extension, I noticed that Travis-CI was reporting a failing status. https://i.stack.imgur.com/pyJdb.png Upon reproducing the issue, it became clear that Chrome was not loading my extension at all. Here is an exampl ...

Implementing parallel execution with POM (Page Factory) for updating records

Looking for some help as I couldn't find a solution to my issue. I'm having trouble running tests in parallel using POM with page factory. *\ Testbase class */ public WebDriver driver; @BeforeClass @Parameters("Browsername&qu ...

The trio of Webdriver, PhantomJS, and Amazon Elastic MapReduce working together revolution

Can Webdriver and PhantomJS be installed on Amazon Elastic Mapreduce AMIs? If I use sudo apt-get to install dependencies in a bootstrap script, will it need to run each time a task is executed or will the installations persist? Is it possible to pre-buil ...

Error: The state of the element is invalid for importing a file

Currently, I am working on creating an automated test to import multiple files using the web application's UI. When the "Import" button is clicked, it launches Windows Explorer. The XPATH I'm using in my test is as follows: filename_field = //di ...