appium / appium/java-client

bug: BaseActivateApplicationOptions setting does not take effect

Open
#2,141 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
1.3k
Forks
752
Avg merge
6d 21h
Merged PRs (30d)
8

Description

Do I have the most recent component updates?
  • I use the most recent available driver/plugin and server versions
Is the component officially supported by the Appium team?
  • I have verified the component repository is present under the Appium organization in GitHub
Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior

iosDriver.activateApp(caseContext.getBundleId(), new BaseActivateApplicationOptions() { @Override public Map<String, Object> build() { JSONObject jsonObject = new JSONObject(); jsonObject.put("configEnv", "xxx"); return Map.of("environment", jsonObject); } });

I want to via in some parameters when the app starts to control the status of certain functions in the app, but it does not actually take effect.

I tried the value "xxx" on android, and it worked. adb command "adb shell am start -n ctrip.english/com.ctrip.ibu.myctrip.main.module.home.IBUHomeActivity --es configEnv xxx"

I also searched for other related information, such as through
wda.Client().session(cls.package_name, environment={"configEnv": xxx}) ,and it worked also.

Expected Behavior

I want to know how set this param via appium java(by the way, the "configEnv" is a parameter defined by ourselves )

Minimal Reproducible Example

iosDriver.activateApp(caseContext.getBundleId(), new BaseActivateApplicationOptions() {
@Override
public Map<String, Object> build() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("configEnv", "xxx");
return Map.of("environment", jsonObject);
}
});

Environment
  • Operating system:
    io.appium.java-client: 9.0.0
    platform: ios
    selenium.version:4.16.0
    java.version:11
Link to Appium Logs

No response

Further Information

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the activateApp call and BaseActivateApplicationOptions implementation shown in the issue, then trace how the iOS client handles the built environment map. Compare the iOS path with the working Android command and determine whether the custom configEnv parameter reaches app launch. Done means the parameter takes effect when activating the iOS app, with a regression test if the relevant test location is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.