appium / java-client

Java language binding for writing Appium Tests, conforms to W3C WebDriver Protocol
Apache License 2.0
1.19k stars 752 forks source link

bug: BaseActivateApplicationOptions setting does not take effect #2149

Open jjqi92 opened 3 months ago

jjqi92 commented 3 months ago

Do I have the most recent component updates?

Is the component officially supported by the Appium team?

Is there an existing issue for this?

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 ),and why does it not worked.

Minimal Reproducible Example

IOSDriver iosDriver = new IOSDriver(appiumDriverLocalService.get(), options);

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

Link to Appium Logs

No response

Further Information

No response