From 35bba6ac38028f232bb9c6421ae9ff993b692354 Mon Sep 17 00:00:00 2001 From: titusfortner Date: Fri, 27 May 2022 00:33:52 -0500 Subject: [PATCH] [dotnet] implement a way to reset Action builder sequences after perform is called --- dotnet/src/webdriver/Interactions/ActionBuilder.cs | 8 ++++++++ dotnet/src/webdriver/Interactions/Actions.cs | 1 + 2 files changed, 9 insertions(+) diff --git a/dotnet/src/webdriver/Interactions/ActionBuilder.cs b/dotnet/src/webdriver/Interactions/ActionBuilder.cs index 052c65041666f..21c8919287b68 100644 --- a/dotnet/src/webdriver/Interactions/ActionBuilder.cs +++ b/dotnet/src/webdriver/Interactions/ActionBuilder.cs @@ -66,6 +66,14 @@ public IList ToActionSequenceList() return new List(this.sequences.Values).AsReadOnly(); } + /// + /// Resets the list of sequences. + /// + public void ClearSequences() + { + this.sequences = new Dictionary(); + } + /// /// Returns a string that represents the current . /// diff --git a/dotnet/src/webdriver/Interactions/Actions.cs b/dotnet/src/webdriver/Interactions/Actions.cs index be4a530603b72..26b15fbb1cc0e 100644 --- a/dotnet/src/webdriver/Interactions/Actions.cs +++ b/dotnet/src/webdriver/Interactions/Actions.cs @@ -483,6 +483,7 @@ public IAction Build() public void Perform() { this.actionExecutor.PerformActions(this.actionBuilder.ToActionSequenceList()); + this.actionBuilder.ClearSequences(); } ///