-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Improve readability for Execute in AppiumCommandExecutor.cs #629
Conversation
b9aa703
to
9ae05d0
Compare
@Dor-bl sorry i missed this PR. Did you find the reason why the execute method is flaky? |
@laolubenson, all good. |
@laolubenson, I'm in between here regarding the retry mechanism, it's not so elegant but does the trick when it comes to the flakiness of the execute method. |
Change list
Split the execute method into 3 small methods:
a. HandleCommandException
b. HandleCommandCompletion
c. HandleNewSessionCommand
Since I've noticed flakiness when we send commands, I've implemented a retry mechanism based on response status in the Execute method. The method now attempts command execution up to MaxRetryAttempts times, checking the success status of the response before returning. I'm still in between about this change, not sure if it's a good approach at all, all I know is that it has improved the stability of the tests.
Types of changes
What types of changes are you proposing/introducing to .NET client?
Put an
x
in the boxes that applyDocumentation
This can be done by navigating to the documentation section on http://appium.io selecting the appropriate command/endpoint and clicking the 'Edit this doc' link to update the C# example
Integration tests
Details
Please provide more details about changes if it is necessary. If there are new features you can provide code samples which show the way they
work and possible use cases. Also you can create gists with pasted C# code samples or put them here using markdown.
About markdown please read Mastering markdown and Writing on GitHub