Skip to content

Conversation

@Dor-bl
Copy link
Collaborator

@Dor-bl Dor-bl commented Dec 24, 2025

List of changes

This pull request introduces a new, strongly-typed StartActivity method for starting Android activities in the Appium .NET client, making it easier and safer to launch activities with a variety of parameters. The change is implemented both in the command execution helper and exposed as a convenient method on the AndroidDriver class. The integration tests are updated to use this new method, replacing direct calls to ExecuteScript for starting activities.

Android Activity Launch Improvements:

  • Added a new StartActivity method to AndroidCommandExecutionHelper that accepts strongly-typed parameters for launching Android activities, supporting all relevant intent arguments and options.
  • Exposed the StartActivity method on the AndroidDriver class, allowing users to start activities using a simple, type-safe API instead of constructing raw script commands.

Test Suite Updates:

  • Updated integration tests in ElementTest.cs to use the new StartActivity method rather than the lower-level ExecuteScript call, improving readability and maintainability. [1] [2] [3] [4]

Types of changes

What types of changes are you proposing/introducing to the .NET client?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change that adds functionality or value)
  • Breaking change (fix or feature that would cause existing functionality not to work as expected)
  • Test fix (non-breaking change that improves test stability or correctness)

Documentation

  • Have you proposed a file change/ PR with Appium to update documentation?

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

  • Have you provided integration tests for your changes? (required for Bugfix, New feature, or Test fix)

Details

Please provide more details about changes if necessary. You can provide code samples showing how they work and possible use cases if there are new features. 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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a strongly-typed StartActivity method for the Android driver to simplify launching Android activities with various configuration options. The implementation wraps the mobile:startActivity script command with a type-safe API and includes comprehensive parameter support for intent arguments, flags, and activity options.

Key Changes:

  • Added StartActivity method to AndroidCommandExecutionHelper and AndroidDriver with support for 15 optional parameters including wait, stop, windowing mode, action, URI, categories, extras, and flags
  • Refactored integration tests in ElementTest.cs to use the new method instead of raw ExecuteScript calls

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/Appium.Net/Appium/Android/AndroidCommandExecutionHelper.cs Implements the core StartActivity method with parameter validation and dictionary building logic to construct the mobile command
src/Appium.Net/Appium/Android/AndroidDriver.cs Exposes the StartActivity method as a public API on the driver class with XML documentation
test/integration/Android/ElementTest.cs Updates four test methods to use the new StartActivity method for improved readability and type safety

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@KazuCocoa KazuCocoa merged commit cf9bb93 into appium:main Dec 31, 2025
2 of 3 checks passed
@Dor-bl Dor-bl deleted the start-activity-command branch December 31, 2025 18:09
@KazuCocoa KazuCocoa added the size:S contribution size: S label Jan 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement size:S contribution size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants