#16 楼 @lihuazhang soga,thx
请问一下这个是把网络协议也模拟成功,还是只是网速模拟啊?
suiteAuroraMusic = unittest.TestSuite()
suiteAuroraMusic.addTest(TestCase_Music.MusicTest("test_case_049"))
suiteAuroraMusic.addTest(TestCase_Music.MusicTest("test_case_001"))
#6 楼 @weamylady
你可以建议公司自己搞个内部的 yum 源或 apt 源。
厉害。喜欢这样的文章。
lz 可参照下:
View view = null;
ListView listview = solo.getCurrentViews(ListView.class,view).get(0);
LinearLayout LL = (LinearLayout) listview.getChildAt(2);
TextView tx = (TextView) LL.findViewById(R.id.text);
在 LinearLayout 那指定第几个。。
ruby 怎么掉得这么惨
#2 楼 @seveniruby
1、间隔 0.3 秒是因为从 操作->画帧开始->画帧结束 这个过程小于 1 秒完成的,为了数据能够覆盖画帧整个过程,所以设置 0.3 秒(其实这样可能不准)。然后我针对结果掐头去尾,我不仅统计了平均值,也计算最小值,也就是掉帧掉到什么程度。这个会是报告一个标准值。
2、我看了 surface_stats_collector.SurfaceStatsCollector 函数,其实就是我上面贴的源码。完整版如下:
def _GetSurfaceFlingerFrameData(self):
"""Returns collected SurfaceFlinger frame timing data.
Returns:
A tuple containing:
- The display's nominal refresh period in seconds.
- A list of timestamps signifying frame presentation times in seconds.
The return value may be (None, None) if there was no data collected (for
example, if the app was closed before the collector thread has finished).
"""
# adb shell dumpsys SurfaceFlinger --latency <window name>
# prints some information about the last 128 frames displayed in
# that window.
# The data returned looks like this:
# 16954612
# 7657467895508 7657482691352 7657493499756
# 7657484466553 7657499645964 7657511077881
# 7657500793457 7657516600576 7657527404785
# (...)
#
# The first line is the refresh period (here 16.95 ms), it is followed
# by 128 lines w/ 3 timestamps in nanosecond each:
# A) when the app started to draw
# B) the vsync immediately preceding SF submitting the frame to the h/w
# C) timestamp immediately after SF submitted that frame to the h/w
#
# The difference between the 1st and 3rd timestamp is the frame-latency.
# An interesting data is when the frame latency crosses a refresh period
# boundary, this can be calculated this way:
#
# ceil((C - A) / refresh-period)
#
# (each time the number above changes, we have a "jank").
# If this happens a lot during an animation, the animation appears
# janky, even if it runs at 60 fps in average.
#
# We use the special "SurfaceView" window name because the statistics for
# the activity's main window are not updated when the main web content is
# composited into a SurfaceView.
results = self._adb.RunShellCommand('dumpsys SurfaceFlinger --latency ' + self._activity)
if not len(results):
return (None, None)
timestamps = []
nanoseconds_per_second = 1e9
refresh_period = long(results[0]) / nanoseconds_per_second
# If a fence associated with a frame is still pending when we query the
# latency data, SurfaceFlinger gives the frame a timestamp of INT64_MAX.
# Since we only care about completed frames, we will ignore any timestamps
# with this value.
pending_fence_timestamp = (1 << 63) - 1
for line in results[1:]:
fields = line.split()
if len(fields) != 3:
continue
timestamp = long(fields[1])
if timestamp == pending_fence_timestamp:
continue
timestamp /= nanoseconds_per_second
timestamps.append(timestamp)
return (refresh_period, timestamps)
这个不是 webview 吧。只是单纯是 listview 下的一个 view;
webview 应该类似这个吧;
#17 楼 @nancy2896 要把 udid 和和端口号对应。我配置如下:
1、appium -p 4492 -bp 2251 -U 7b6312(这是 udid 哦)
2、appium -p 4493 -bp 2252 -U 1832596f(这是 udid 哦)
然后是跑两个脚本(我是用 python 的)。我亲自测试可以了。
感谢你们的提问和反馈啊,把一个一直困扰我的问题解决了。。
#14 楼 @nancy2896 你试试用如下代码:
self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
指定服务端口时,4723 改成 4725 看看
#14 楼 @nancy2896 谢谢你的回复。。
你是要同时并行两个设备进行测试吗?据我所知,目前 appium 还不支持,求打脸。。
1 已经是一个真实坐标值了,0 应该是 appium 无法识别的坐标。
所以对应的真实值应该是 1/960/1920
你试试看把 0,1 这些改成对应的真实的最大/最小坐标值。。
有用,谢分享