I'm looking at implementing a runsettings file for automated testing. Thing is, my variables are complex objects, and all I can find in the documentation about runsettings has simple key/value options, like so.
<TestRunParameters>
<Parameter name="webAppUrl" value="http://localhost" />
<Parameter name="docsUrl" value="https://docs.microsoft.com" />
</TestRunParameters>
I'm wondering if it's possible to specify a complex object like you might specify below (especially since TextContext.Properties returns an object, so I assume it's polymorphic in some sense?) and cast it to a given defined class
<TestRunParameters>
<Parameter name="AdminUser" UserID="Admin" Password="P@55w0rd!" />
<Parameter name="User" UserID="User" Password="P@55w0rd!" />
</TestRunParameters>
I realize I can do the below and manually create my object instances, but I'd really really like to avoid it if at all possible
<TestRunParameters>
<Parameter name="AdminUserID" value="Admin"/>
<Parameter name="AdminUserPW" value="P@55w0rd!" />
<Parameter name="UserID" value="User"/>
<Parameter name="UserPW" value="P@55w0rd!" />
</TestRunParameters>
question from:
https://stackoverflow.com/questions/66052899/is-it-possible-to-configure-a-net-runsettings-file-to-include-complex-objects 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…