Capgemini / Capgemini/powerapps-specflow-bindings

Creating Acitivity Email with valid JSON syntax gets error: Invalid Recipient Type

Open
#109 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
C#
Stars
42
Forks
27
PR merge metrics
No merged PRs in 30d

Description

## Describe the bug
In dynamics in the Sales module I am creating a activity, Email through deep insert with JSON. When using the correct JSON format and correct data the step of creating the record from the JSON the error: OpenQA.Selenium.WebDriverException: driver encountered an error: Invalid Recipient Type is returned.
## To reproduce
_Steps to reproduce the behaviour._
1. Create a json "Test Email.JSON" with the following syntax:
{
"@logicalName": "email",
"@alias": "Test Email",
"subject": "Email through JSON",
"email_activity_parties": [
{
"participationtypemask": 2,
"partyid_account@odata.bind": "/accounts(5700355c-0d42-ec11-8c62-6045bd8d9795)"
},
{
"participationtypemask": 1,
"partyid_systemuser@odata.bind": "/systemusers(5b6c3f65-df2c-ec11-b6e5-000d3a25cb45)"
}
]
}
replace the account GUID with a valid GUID in your environment and do the same with a user account in systemusers.
2. create a feature file with the following scenario: ( replace names with own valid names)
Given I am logged in to the 'Dynamics 365 — custom' app as 'a salesperson'
When I can see the 'Leads' button I continue the test
When I have selected the right module 'Sales' I continue the test
Given I have created 'Test Mail'

3. You can replace the account with a contact through this:
"partyid_contact@odata.bind": "/contacts(5700355c-0d42-ec11-8c62-6045bd8d9795)"

it will generate the same error (use a valid GUID from your environment of a contact)

## Expected behaviour
A email acitivity record is created during the test run.

## Environment (please complete the following information):
- Test framework: NUnit
- Browser: chrome
- Version: 0.14.4-feat-2021-relea-0003
- Power Apps environment version: ?

## Additional context
Message: 
Test method Lighthouse.Features.Sales.CreateLeadsManuallyAfterFeature.CreateEmailThroughJSON threw exception:
OpenQA.Selenium.WebDriverException: driver encountered an error: Invalid Recipient Type

Stack Trace: 
TestDriver.ExecuteDriverFunctionAsync(String functionCall)
TestDriver.LoadTestData(String data)
DataSteps.GivenIHaveCreated(String fileName)
lambda_method(Closure , IContextManager , String )
BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) line 73
TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments, TimeSpan& duration) line 581
TestExecutionEngine.ExecuteStep(IContextManager contextManager, StepInstance stepInstance) line 494
TestExecutionEngine.OnAfterLastStep() line 210
TestRunner.CollectScenarioErrors() line 59
CreateLeadsManuallyAfterFeature.ScenarioCleanup()
CreateLeadsManuallyAfterFeature.CreateEmailThroughJSON() line 85

![image](https://user-images.githubusercontent.com/4244807/152323787-e231fe3e-0443-4a58-af13-9dd3317acba7.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.