Grouping using Xunit by speckle

Hello,
I am using the xunit runner to create groups to test against our application. Am I missing somthing in the xru file. Here is my code

//Group Elements
public static Group GroupElements(IList<ElementId> e)
{
  Group group = null;
  //UiContext.Send(x => Uiapp.ActiveUIDocument.Selection.SetElementIds(e), null);
  UiContext.Send(x => group = Uiapp.ActiveUIDocument.Document.Create.NewGroup(e), null);
  return group;
}

image

Can you give any more details about where that exception is being thrown? Or if there are inner exception objects that will provide more information.

Either your code, Speckle XUnitRevit, or the Revit API itself is causing this; it may well be the latter.

I’m flying blind here, but are your grouping instructions within a Transaction call?