Question

Is it possible to call .NET Invoke method from SilkTest test case? I can call it using DynamicInvoke method, but I don't know what to pass as parameters that would be equal to method delegate.

Était-ce utile?

La solution

It's not possible to call methods with DynamicInvoke that require arguments that can't be represented by Silk Test's types or offer a simple constructor which can be auto-detected (default constructor, or constructor taking a String argument).

That being said, there might be solutions to your issue:

  • If you have access to the application's code, you can add a method to the UI element that does whatever you intend to do with the Invoke call, and call that wrapper method instead
  • With the upcoming Silk Test 14 release, you have the option to DynamicInvoke arbitrary static methods in you application, which again can be used as a wrapper around Invoke.
  • Also with Silk Test 14, you'll be able to load custom assemblies and call methods there, so if you don't want to pollute your application with functionality for testing, put that in a custom assembly and load it for your tests.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top