#24 楼 @shijin880921 这个是没有登录吧。
支持下。。😁
—— 来自 TesterHome 官方 安卓客户端
好高大上啊。先顶了。
—— 来自 TesterHome 官方 安卓客户端
先收藏,刚好需要 感谢。。
@chenhengjie123 帮忙看看这个是啥问题?
com.qding.community.home.activity.SplashActivity 这个 Activity 是欢迎页的还是启动页的?
总结的很好!赞
来自 Android 客户端
感谢分享
两个问题:
1.像对某一个音乐进行下单的话,url 中肯定会带上这个音乐的 id,那接口自动化的话需要遍历所有的音乐吗?还是说只需要测试一条就可以了。
2.另外 url 中动态的数据要如何进行处理呢?
写的真心不错
强烈要求录视频
已报名。
AndroidTest.GoUserTab(self) # 这样用没有问题
#AndroidTest.User.GoUserTab2(self) # 这样用会报错
如果我没想错的话 第一句你完全可以使用 self.GoUserTab() 调用
而第二个报错的原因是你要实例化出一个 User 的对象才能够调用里面的 GoUserTab2,除非你把 GoUserTab2 改成类方法。
周六 我试试看,只要别嫌弃 哈哈
#10 楼 @chenhengjie123 额 我错了,我竟然没注意到
if (!el.getText().isEmpty()) {
// clear could have failed, or we could have a hint in the field
// we'll assume it is the latter
Logger.debug("Text not cleared. Assuming remainder is hint text.");
currText = "";
}
不细心了 sorry 我拿一个原生的系统来验证下。
#10 楼 @chenhengjie123
还是不太明白 clearText() 方法确实没有执行成功,但是我们这样子看
boolean replace = Boolean.parseBoolean(params.get("replace").toString());
String text = params.get("text").toString();
...
boolean unicodeKeyboard = false;
if (params.get("unicodeKeyboard") != null) {
unicodeKeyboard = Boolean.parseBoolean(params.get("unicodeKeyboard").toString());
}
String currText = el.getText();
new Clear().execute(command);
if (!el.getText().isEmpty()) {
// clear could have failed, or we could have a hint in the field
// we'll assume it is the latter
Logger.debug("Text not cleared. Assuming remainder is hint text.");
currText = "";
}
if (!replace) {
text = currText + text;
}
final boolean result = el.setText(text, unicodeKeyboard);
if (!result) {
return getErrorResult("el.setText() failed!");
}
...
return getSuccessResult(result);
还是引用这段 setText 的代码,假设这个时候我的输入框的内容当前已经有个内容"hello"了 ,这个 “hello” 并不是 hint 文字,而是我上次输入的,那么从上面代码看 ,首先是 String currText = el.getText(); 首先是拿到文本的内容也就是 hello。 再来才是执行清除文本的命令, 之后判断 replace 如果为 false 的话,就 text = currText + text; 所以我觉得这个跟是否成功清除文本应该是没有关系的才对啊。
不知道我说的清楚不?
appium 1.4.0 为什么 sendkeys 又是没有追加呢 没太懂
> info: --> POST /wd/hub/session/82a36e8f-5508-4429-888c-1961916a7e2e/element/4/value {"sessionId":"82a36e8f-5508-4429-888c-1961916a7e2e","id":"4","value":["h","e","l","o",".","e","v","e","r","y","o","n","e"]}
> info: [debug] Pushing command to appium work queue: ["element:setText",{"elementId":"4","text":"helo.everyone","replace":false,"unicodeKeyboard":true}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:setText","params":{"elementId":"4","text":"helo.everyone","replace":false,"unicodeKeyboard":true}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: setText
> info: [debug] [BOOTSTRAP] [debug] Using element passed in.
> info: [debug] [BOOTSTRAP] [debug] Attempting to clear using UiObject.clearText().
> info: [debug] [BOOTSTRAP] [debug] Sending plain text to element: helo.everyone
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"82a36e8f-5508-4429-888c-1961916a7e2e"}
> info: <-- POST /wd/hub/session/82a36e8f-5508-4429-888c-1961916a7e2e/element/4/value 200 5542.413 ms - 76 {"status":0,"value":true,"sessionId":"82a36e8f-5508-4429-888c-1961916a7e2e"}
> info: --> POST /wd/hub/session/82a36e8f-5508-4429-888c-1961916a7e2e/element/4/value {"sessionId":"82a36e8f-5508-4429-888c-1961916a7e2e","id":"4","value":["s","s","s","s"]}
> info: [debug] Pushing command to appium work queue: ["element:setText",{"elementId":"4","text":"ssss","replace":false,"unicodeKeyboard":true}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:setText","params":{"elementId":"4","text":"ssss","replace":false,"unicodeKeyboard":true}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: setText
> info: [debug] [BOOTSTRAP] [debug] Using element passed in.
> info: [debug] [BOOTSTRAP] [debug] Attempting to clear using UiObject.clearText().
> info: [debug] [BOOTSTRAP] [debug] Clearing text not successful. Attempting to clear by selecting all and deleting.
> info: [debug] [BOOTSTRAP] [debug] Clearing text not successful. Attempting to clear by sending delete keys.
> info: [debug] [BOOTSTRAP] [error] error while getting method injectInputEvent from class class com.android.uiautomator.core.UiAutomatorBridge with parameter types [class android.view.InputEvent, class java.lang.Boolean] injectInputEvent [class android.view.InputEvent, class java.lang.Boolean]
> info: [debug] [BOOTSTRAP] [debug] Text not cleared. Assuming remainder is hint text.
> info: [debug] [BOOTSTRAP] [debug] Sending plain text to element: ssss
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"82a36e8f-5508-4429-888c-1961916a7e2e"}
我个人的想法 连续 sendkey 以后 都是会调用 setText() 方法的,那为什么第二次 setText 的时候的那个不是 “helo.everyssss” 而只是 ‘ssss’ 求助。
看 log 信息已经很明显了
Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
你确定下你启动的 Activity 是否正确
我一般是在 setUpClass 里面进行初始化的,这样子会节省很多。