I'll show my question with an example:
ChromeDriver chrome = new ChromeDriver();
chrome.Capabilities.GetCapability("chrome");
Returns an object which is of type Dictionary<string, object>
.
Inside this object there's a key userDataDir
whose value I need.
Do I have to cast the object to a dictionary first or can I do some one-liner like:
chrome.Capabilities.GetCapability("chrome").GetType().GetProperty("userDataDir").GetValue()
The line above isn't compiled just to clarify.