在我的测试中,我们需要调用url方案进行诊断,但该方法不支持&。
driver.get(abc-xx://qa-preview?adunit=banner)
它正在运作
driver.get(abc-xx://qa-preview?adunit=banner&lat=10)
当我追加&它不起作用并抛出以下消息
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Error attempting to start URI. Original error: Error: Error executing adbExec. Original error: 'Command '/Users/abc/Library/Android/sdk/platform-tools/adb -P 5037 -s 83f0374b42535532 shell am start -W -a android.intent.action.VIEW -d abc-xx\://qa-preview\?adunit\=banner\&ctg\=2280352\&flt\=0\&nwk\=54 com.abc.droid.qa' exited with code 127'; Stderr: '/system/bin/sh: com.abc.droid.qa: not found'; Code: '127' (WARNING: The server did not provide any stacktrace information)
我已经对网址进行了编码并尝试通过,但我的应用不支持。在我们的应用程序中,方案仅支持普通URL。这个问题有没有解决方法?
答案 0 :(得分:0)
String url = "Your URL Containing &";
String url1 = url.trim();
String url2 = url1.replace(/&/g,"-");