Skip to content

SetProperty() and Assert() does not work with controls inside EditForm #674

@balintantal

Description

@balintantal

Describe the bug

In case I try to use Assert() or SetProperty() functions on a control that is inside a Form, Test Engine throws an error: "System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation."

In Test Sudio, it works well.

If I make a copy of the control outside the form, Assert and SetProperty works well.

To Reproduce

Steps to reproduce the behavior:

  1. Create a canvas app and place an Edit Form control on it
  2. Set up a proper data source, add some datacards
  3. Configure your test plan, create a test case that tries Assert or SetProperty on any of the DataCardValue controls

Expected Behavior: Provided value is set or asserted
Actual Behavior: Engine throws an error and test execution fails

Additional context

testPlan.yaml

TestEngineApp_20260401141554.zip

Log details:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.AggregateException: One or more errors occurred. (0)
---> Microsoft.Playwright.PlaywrightException: 0
at Microsoft.Playwright.Transport.Connection.InnerSendMessageToServerAsync[T](ChannelOwner object, String method, Dictionary2 dictionary, Boolean keepNulls) in /_/src/Playwright/Transport/Connection.cs:line 201 at Microsoft.Playwright.Transport.Connection.WrapApiCallAsync[T](Func1 action, Boolean isInternal, String title) in //src/Playwright/Transport/Connection.cs:line 499
at Microsoft.Playwright.Core.Frame.EvaluateAsync[T](String script, Object arg) in /
/src/Playwright/Core/Frame.cs:line 714
at Microsoft.PowerApps.TestEngine.TestInfra.PlaywrightTestInfraFunctions.RunJavascriptAsync[T](String jsExpression) in C:\Users\antalb\Documents\PaTest\PowerApps-TestEngine\src\Microsoft.PowerApps.TestEngine\TestInfra\PlaywrightTestInfraFunctions.cs:line 493
at Microsoft.PowerApps.TestEngine.Providers.PowerAppFunctions.SetPropertyDateAsync(ItemPath itemPath, DateValue value) in C:\Users\antalb\Documents\PaTest\PowerApps-TestEngine\src\testengine.provider.canvas\PowerAppFunctions.cs:line 317
at Microsoft.PowerApps.TestEngine.Providers.PowerAppFunctions.SetPropertyAsync(ItemPath itemPath, FormulaValue value) in C:\Users\antalb\Documents\PaTest\PowerApps-TestEngine\src\testengine.provider.canvas\PowerAppFunctions.cs:line 283
at Microsoft.PowerApps.TestEngine.PowerFx.Functions.SetPropertyFunction.SetProperty(RecordValue obj, StringValue propName, FormulaValue value) in C:\Users\antalb\Documents\PaTest\PowerApps-TestEngine\src\Microsoft.PowerApps.TestEngine\PowerFx\Functions\SetPropertyFunction.cs:line 44
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at Microsoft.PowerApps.TestEngine.PowerFx.Functions.SetPropertyFunction.Execute(RecordValue obj, StringValue propName, FormulaValue value) in C:\Users\antalb\Documents\PaTest\PowerApps-TestEngine\src\Microsoft.PowerApps.TestEngine\PowerFx\Functions\SetPropertyFunction.cs:line 32
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span1 copyOfArgs, BindingFlags invokeAttr) --- End of inner exception stack trace --- at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span1 copyOfArgs, BindingFlags invokeAttr)
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Microsoft.PowerFx.ReflectionFunction.InvokeAsync(IServiceProvider serviceProvider, IReadOnlyList`1 args, CancellationToken cancellationToken)
at Microsoft.PowerFx.CustomSetPropertyFunction.InvokeAsync(FormulaValue[] args, CancellationToken cancellationToken)
at Microsoft.PowerFx.EvalVisitor.TryHandleSetProperty(CallNode node, EvalVisitorContext context)
at Microsoft.PowerFx.EvalVisitor.Visit(CallNode node, EvalVisitorContext context)
at Microsoft.PowerFx.ParsedExpression.EvalAsync(CancellationToken cancellationToken, IRuntimeConfig runtimeConfig)
at Microsoft.PowerFx.RecalcEngine.EvalAsync(String expressionText, CancellationToken cancellationToken, ParserOptions options, ReadOnlySymbolTable symbolTable, RuntimeConfig runtimeConfig)
at Microsoft.PowerApps.TestEngine.PowerFx.PowerFxEngine.ExecuteAsync(String testSteps, CultureInfo culture) in C:\Users\antalb\Documents\PaTest\PowerApps-TestEngine\src\Microsoft.PowerApps.TestEngine\PowerFx\PowerFxEngine.cs:line 480
at Microsoft.PowerApps.TestEngine.PowerFx.PowerFxEngine.ExecuteWithRetryAsync(String testSteps, CultureInfo culture) in C:\Users\antalb\Documents\PaTest\PowerApps-TestEngine\src\Microsoft.PowerApps.TestEngine\PowerFx\PowerFxEngine.cs:line 400
at Microsoft.PowerApps.TestEngine.SingleTestRunner.RunTestAsync(String testRunId, String testRunDirectory, TestSuiteDefinition testSuiteDefinition, BrowserConfiguration browserConfig, String domain, String queryParams, CultureInfo locale) in C:\Users\antalb\Documents\PaTest\PowerApps-TestEngine\src\Microsoft.PowerApps.TestEngine\SingleTestRunner.cs:line 264

Metadata

Metadata

Assignees

No one assigned

    Labels

    newAn Issue created that needs to be looked at by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions