Replies: 1 comment
-
Thanks for continually improving SeleniumVBA, it's getting hotter and hotter :) About this addition, I personally currently don't need it because I'm fine with current factory settings as default settings. Anyway, I have no comments to make except maybe on the clarity of the calling lines:
If I hadn't read your explanation and the content of the function, I wouldn't have understood that the Ini file is optional and that oShell.Namespace("shell:Downloads").Self.Path is the default returning value when the particular entry or even the whole Ini file doesn't exist. However, I can't think of a better solution, so I'll get over it :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm contemplating adding functionality for customizing SeleniumVBA settings prior to run-time such as where to locate drivers, pre-loading capabilities from file, auto-driver-updating parameters, etc.
Principle design objectives:
My current draft approach is to create a file called SeleniumVBA.ini in the same folder as the SeleniumVBA add-in. At object initialization, read the relevant INI entries to initialize global variables. If the INI file does not exist, or the entries do not exist in the file, then fall back on the current SeleniumVBA "system" defaults.
Here is a draft version of what the SeleniumVBA.ini file might contain:
As far as implementation goes, I've been experimenting with the following api technique for reading from the INI file:
In the Class_Initialize Sub(s), the above would be called like below, where the last parameter of ReadIniFileEntry is the system default value:
Some of the nice properties of the api approach above are that it is random access - can read from the file only the entries that are needed when they are needed in SeleniumVBA without consuming the entire file, entries are order independent, case insensitivity of key/entry values, and very forgiving - if an entry key is misspelled, or a value is left blank, the approach will not throw an error - just returns null, which is then replaced with the default.
The SeleniumVBA.ini file could either be copied from the GitHub distribution folder, and/or created via a method of the WebDriver class, such as this easy to maintain method below:
The implementation outlined above requires several minor changes elsewhere, but in no way would affect the current functionality - only optionally extend it. I've had to add support for the %Environ% syntax in GetFullLocalPath, and refactor OpenBrowser to auto-load capabilities json files if specified in the settings, as below.
Anyway, reaching out for community feedback before taking any action, while continuing testing. Let me know your thoughts!
Beta Was this translation helpful? Give feedback.
All reactions