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

Open
#674 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
csharp, playwright
Domain
testing-qa

Research direction

Start with SetPropertyFunction.cs and PowerAppFunctions.cs, following the failing SetPropertyDateAsync path into PlaywrightTestInfraFunctions.cs. Reproduce the issue with the attached testPlan.yaml and app archive, then compare behavior for controls inside and outside an EditForm. Done means Assert and SetProperty work for DataCardValue controls without the reported exception.

Written by the indexing model from the issue text.

Description

new

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

Dominant language
C#
Stars
150
Forks
55
Avg merge
5d 23h
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/PowerApps-TestEngine

All issues in microsoft/PowerApps-TestEngine

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.