Skip to content

(instance) function does not work with additional parameter #12

Description

@priornix

Hi,

Nice project.

Creating a ChromeDriver using the function from (webica.chrome-driver/start-chrome), but I am trying to create a ChromeDriver that takes in an additional ChromeOptions parameter, so I copied out (start-chrome) and modified it as follows:

(defn start-chrome [&[chromedriver args]]
  (let [driver-prop "webdriver.chrome.driver"
        default-exe (System/getProperty driver-prop)
        chromedriver-system "/usr/lib/chromium/chromedriver"
        chromedriver-local "/usr/local/bin/chromedriver"
        chromedriver (or chromedriver
                         (if (and (not (empty? default-exe))
                                  (fs/exists? default-exe))
                           default-exe)
                         (if (fs/exists? chromedriver-system)
                           chromedriver-system)
                       chromedriver-local)]
    (if-not (fs/exists? chromedriver)
      (throw
        (RuntimeException.
          (str "ERROR: chromedriver executable not found:" chromedriver))))
    (System/setProperty driver-prop chromedriver)
    (instance args)))

However, the (instance) introspection does not seem to be working and the ChromeDriver did not receive the correct options, as I have checked the ChromeDriver log files. It only worked when I replaced (instance args) with (ChromeDriver. args)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions