How to use using_ios_tagent method in Airtest

Best Python code snippet using Airtest

ios.py

Source:ios.py Github

copy

Full Screen

...110 @property111 def uuid(self):112 return self.addr113 @property114 def using_ios_tagent(self):115 """116 当前基础版本:appium/WebDriverAgent 4.1.4117 基于上述版本,2022.3.30之后发布的iOS-Tagent版本,在/status接口中新增了一个Version参数,如果能检查到本参数,说明使用了新版本ios-Tagent118 该版本基于Appium版的WDA做了一些改动,可以更快地进行点击和滑动,并优化了部分UI树的获取逻辑119 但是所有的坐标都为竖屏坐标,需要airtest自行根据方向做转换120 同时,大于4.1.4版本的appium/WebDriverAgent不再需要针对ipad进行特殊的横屏坐标处理了121 Returns:122 """123 if self._using_ios_tagent is None:124 status = self.driver.status()125 if 'Version' in status:126 self._using_ios_tagent = True127 else:128 self._using_ios_tagent = False...

Full Screen

Full Screen

__init__.py

Source:__init__.py Github

copy

Full Screen

1# coding=utf-82import xml.etree.ElementTree as ET3from poco.pocofw import Poco4from poco.agent import PocoAgent5from poco.freezeui.hierarchy import FrozenUIDumper, FrozenUIHierarchy6from poco.utils.airtest import AirtestInput, AirtestScreen7from poco.utils import six8from airtest.core.api import device as current_device9try:10 from airtest.core.ios.rotation import XYTransformer11except AttributeError:12 raise RuntimeError('The iOS module of Airtest>1.1.7 only supports python3, if you want to use, please upgrade to python3 first.')13from pprint import pprint14class iosPoco(Poco):15 def __init__(self, device=None, **kwargs):16 device = device or current_device()17 if not device or device.__class__.__name__ != 'IOS':18 raise RuntimeError('Please call `connect_device` to connect an iOS device first')19 agent = iosPocoAgent(device)20 super(iosPoco, self).__init__(agent, **kwargs)21class iosPocoAgent(PocoAgent):22 def __init__(self, client):23 self.client = client24 hierarchy = FrozenUIHierarchy(iosDumper(self.client))25 screen = AirtestScreen()26 input = AirtestInput()27 super(iosPocoAgent, self).__init__(hierarchy, input, screen, None)28class iosDumper(FrozenUIDumper):29 def __init__(self, client):30 super(iosDumper, self).__init__()31 self.client = client32 self.size = client.display_info["window_width"], client.display_info["window_height"]33 def dumpHierarchy(self, onlyVisibleNode=True):34 # 当使用了appium/WebDriverAgent时,ipad横屏且在桌面下,坐标需要按照竖屏坐标额外转换一次35 # 判断条件如下:36 # 当ios.using_ios_tagent有值、且为false,说明使用的是appium/WebDriverAgent37 # airtest<=1.2.4时,没有ios.using_ios_tagent的值,说明也是用的appium/wda38 if ((hasattr(self.client, "using_ios_tagent") and not self.client.using_ios_tagent) or39 (not hasattr(self.client, "using_ios_tagent"))) \40 and (self.client.is_pad and self.client.orientation != 'PORTRAIT' and self.client.home_interface()):41 switch_flag = True42 else:43 switch_flag = False44 jsonObj = self.client.driver.source(format='json')45 w, h = self.size46 if self.client.orientation in ['LANDSCAPE', 'UIA_DEVICE_ORIENTATION_LANDSCAPERIGHT']:47 w, h = h, w48 data = json_parser(jsonObj, (w, h), switch_flag=switch_flag, ori=self.client.orientation)49 return data50 def dumpHierarchy_xml(self):51 xml = self.client.driver.source()52 xml = xml.encode("utf-8")53 data = ios_dump_xml(xml, self.size)54 return data55def ios_dump_xml(xml, screen_size):56 root = ET.fromstring(xml)57 data = xml_parser(root, screen_size)58 return data59def json_parser(node, screen_size, switch_flag=False, ori='PORTRAIT'):60 """61 :param node: node info {}62 :param screen_size: ios.windows_size()63 :param switch_flag: If it is an ipad , when on the desktop, all coordinates must be converted to vertical screen coordinates64 :param ori: wda ['PORTRAIT', 'LANDSCAPE',65 'UIA_DEVICE_ORIENTATION_LANDSCAPERIGHT',66 'UIA_DEVICE_ORIENTATION_PORTRAIT_UPSIDEDOWN']67 :return:68 """69 screen_w, screen_h = screen_size70 if "name" in node and node["name"]:71 name = node["name"]72 else:73 name = node["type"]74 data = {75 "name": name,76 "payload": {}77 }78 if six.PY2:79 for key in [x for x in node.keys() if x not in ['frame', 'children']]:80 data["payload"][key.encode("utf-8")] = node[key]81 else:82 for key in [x for x in node.keys() if x not in ['frame', 'children']]:83 data["payload"][key] = node[key]84 w = float(node["rect"]["width"])85 h = float(node["rect"]["height"])86 x = float(node["rect"]["x"])87 y = float(node["rect"]["y"])88 if switch_flag:89 x, y = XYTransformer.ori_2_up(90 (x, y),91 (screen_w, screen_h),92 ori93 )94 if switch_flag and ori == 'LANDSCAPE':95 w, h = h, w96 data["payload"]["pos"] = [97 (x + w / 2) / screen_w,98 (y - h / 2) / screen_h99 ]100 elif switch_flag and ori == 'UIA_DEVICE_ORIENTATION_LANDSCAPERIGHT':101 w, h = h, w102 data["payload"]["pos"] = [103 (x - w / 2) / screen_w,104 (y + h / 2) / screen_h105 ]106 elif switch_flag and ori == 'UIA_DEVICE_ORIENTATION_PORTRAIT_UPSIDEDOWN':107 data["payload"]["pos"] = [108 (x - w / 2) / screen_w,109 (y - h / 2) / screen_h110 ]111 else:112 data["payload"]["pos"] = [113 (x + w / 2) / screen_w,114 (y + h / 2) / screen_h115 ]116 data["payload"]["name"] = name117 data["payload"]["size"] = [w / screen_w, h / screen_h]118 119 data["payload"]["zOrders"] = {120 "local": 0,121 "global": 0,122 }123 data["payload"]["anchorPoint"] = [0.5, 0.5]124 # TODO: w = 0 and h = 0 situation need to solve with125 # roll back set as True when finding a visible child126 if "visible" not in node:127 if (x >= 0 or x + w > 0) and (x < screen_w) and (y >= 0 or y + h > 0) and (y < screen_h):128 data["payload"]["visible"] = True129 elif w == 0 or h == 0:130 data["payload"]["visible"] = True131 else:132 data["payload"]["visible"] = False133 children_data = []134 if "children" in node:135 for child in node["children"]:136 child_data = json_parser(child, screen_size=screen_size, switch_flag=switch_flag, ori=ori)137 children_data.append(child_data)138 if children_data:139 data["children"] = children_data140 if data["payload"]["visible"] is False:141 for child_node in children_data:142 if child_node["payload"].get("visible") is True:143 data["payload"]["visible"] = True144 break145 return data146def xml_parser(node, screen_size):147 # print(node)148 # print(node.attrib)149 screen_w, screen_h = screen_size150 name = node.attrib.get("name", node.tag)151 data = {152 "name": name,153 "payload": node.attrib,154 }155 w = float(node.attrib["width"])156 h = float(node.attrib["height"])157 x = float(node.attrib["x"])158 y = float(node.attrib["y"])159 data["payload"]["name"] = name160 data["payload"]["size"] = [w / screen_w, h / screen_h]161 data["payload"]["pos"] = [162 (x + w / 2) / screen_w,163 (y + h / 2) / screen_h164 ]165 data["payload"]["zOrders"] = {166 "local": 0,167 "global": 0,168 }169 data["payload"]["anchorPoint"] = (0.5, 0.5)170 children_data = []171 for child in node:172 child_data = xml_parser(child, screen_size)173 children_data.append(child_data)174 if children_data:175 data["children"] = children_data176 return data177if __name__ == '__main__':178 XML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<XCUIElementTypeApplication type=\"XCUIElementTypeApplication\" name=\"健康\" label=\"健康\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"812\">\n <XCUIElementTypeWindow type=\"XCUIElementTypeWindow\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"812\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"812\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"812\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"812\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"812\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"812\">\n <XCUIElementTypeNavigationBar type=\"XCUIElementTypeNavigationBar\" name=\"WDTodayDayPageView\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"44\" width=\"375\" height=\"44\">\n <XCUIElementTypeButton type=\"XCUIElementTypeButton\" name=\"五月\" label=\"五月\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"44\" width=\"65\" height=\"44\"/>\n <XCUIElementTypeButton type=\"XCUIElementTypeButton\" name=\"查看个人资料\" label=\"查看个人资料\" enabled=\"true\" visible=\"true\" x=\"334\" y=\"53\" width=\"25\" height=\"26\"/>\n </XCUIElementTypeNavigationBar>\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"812\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"812\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"812\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"812\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"812\">\n <XCUIElementTypeTable type=\"XCUIElementTypeTable\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"812\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" name=\"健身记录\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"176\" width=\"375\" height=\"37\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" name=\"健身记录\" label=\"健身记录\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"176\" width=\"375\" height=\"37\"/>\n </XCUIElementTypeOther>\n <XCUIElementTypeCell type=\"XCUIElementTypeCell\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"213\" width=\"375\" height=\"82\">\n <XCUIElementTypeStaticText type=\"XCUIElementTypeStaticText\" value=\"1.8公里\" name=\"1.8公里\" label=\"1.8公里\" enabled=\"true\" visible=\"true\" x=\"254\" y=\"214\" width=\"93\" height=\"54\"/>\n <XCUIElementTypeStaticText type=\"XCUIElementTypeStaticText\" value=\"今天 上午10:05\" name=\"今天 上午10:05\" label=\"今天 上午10:05\" enabled=\"true\" visible=\"true\" x=\"262\" y=\"266\" width=\"86\" height=\"15\"/>\n <XCUIElementTypeStaticText type=\"XCUIElementTypeStaticText\" value=\"步行 + 跑步距离\" name=\"步行 + 跑步距离\" label=\"步行 + 跑步距离\" enabled=\"true\" visible=\"true\" x=\"28\" y=\"220\" width=\"124\" height=\"21\"/>\n </XCUIElementTypeCell>\n <XCUIElementTypeCell type=\"XCUIElementTypeCell\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"295\" width=\"375\" height=\"82\">\n <XCUIElementTypeStaticText type=\"XCUIElementTypeStaticText\" value=\"2,438步\" name=\"2,438步\" label=\"2,438步\" enabled=\"true\" visible=\"true\" x=\"209\" y=\"296\" width=\"138\" height=\"54\"/>\n <XCUIElementTypeStaticText type=\"XCUIElementTypeStaticText\" value=\"今天 上午10:05\" name=\"今天 上午10:05\" label=\"今天 上午10:05\" enabled=\"true\" visible=\"true\" x=\"262\" y=\"348\" width=\"86\" height=\"15\"/>\n <XCUIElementTypeStaticText type=\"XCUIElementTypeStaticText\" value=\"步数\" name=\"步数\" label=\"步数\" enabled=\"true\" visible=\"true\" x=\"28\" y=\"302\" width=\"35\" height=\"21\"/>\n </XCUIElementTypeCell>\n <XCUIElementTypeCell type=\"XCUIElementTypeCell\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"377\" width=\"375\" height=\"82\">\n <XCUIElementTypeStaticText type=\"XCUIElementTypeStaticText\" value=\"今天 上午9:24\" name=\"今天 上午9:24\" label=\"今天 上午9:24\" enabled=\"true\" visible=\"true\" x=\"268\" y=\"430\" width=\"79\" height=\"15\"/>\n <XCUIElementTypeStaticText type=\"XCUIElementTypeStaticText\" value=\"4层\" name=\"4层\" label=\"4层\" enabled=\"true\" visible=\"true\" x=\"300\" y=\"378\" width=\"48\" height=\"54\"/>\n <XCUIElementTypeStaticText type=\"XCUIElementTypeStaticText\" value=\"已爬楼层\" name=\"已爬楼层\" label=\"已爬楼层\" enabled=\"true\" visible=\"true\" x=\"28\" y=\"384\" width=\"70\" height=\"21\"/>\n </XCUIElementTypeCell>\n </XCUIElementTypeTable>\n </XCUIElementTypeOther>\n </XCUIElementTypeOther>\n </XCUIElementTypeOther>\n </XCUIElementTypeOther>\n </XCUIElementTypeOther>\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"812\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"88\" width=\"375\" height=\"88\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"88\" width=\"375\" height=\"88\">\n <XCUIElementTypeScrollView type=\"XCUIElementTypeScrollView\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"105\" width=\"375\" height=\"35\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"105\" width=\"375\" height=\"58\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" name=\"5月13日 星期日\" label=\"5月13日 星期日\" enabled=\"true\" visible=\"true\" x=\"13\" y=\"110\" width=\"36\" height=\"35\"/>\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" name=\"今天, 5月14日 星期一\" label=\"今天, 5月14日 星期一\" enabled=\"true\" visible=\"true\" x=\"65\" y=\"110\" width=\"36\" height=\"35\"/>\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" name=\"5月15日 星期二\" label=\"5月15日 星期二\" enabled=\"true\" visible=\"true\" x=\"118\" y=\"110\" width=\"35\" height=\"35\"/>\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" name=\"5月16日 星期三\" label=\"5月16日 星期三\" enabled=\"true\" visible=\"true\" x=\"170\" y=\"110\" width=\"35\" height=\"35\"/>\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" name=\"5月17日 星期四\" label=\"5月17日 星期四\" enabled=\"true\" visible=\"true\" x=\"222\" y=\"110\" width=\"35\" height=\"35\"/>\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" name=\"5月18日 星期五\" label=\"5月18日 星期五\" enabled=\"true\" visible=\"true\" x=\"274\" y=\"110\" width=\"36\" height=\"35\"/>\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" name=\"5月19日 星期六\" label=\"5月19日 星期六\" enabled=\"true\" visible=\"true\" x=\"326\" y=\"110\" width=\"36\" height=\"35\"/>\n </XCUIElementTypeOther>\n </XCUIElementTypeScrollView>\n <XCUIElementTypeStaticText type=\"XCUIElementTypeStaticText\" value=\"2018年5月14日 星期一\" name=\"2018年5月14日 星期一\" label=\"2018年5月14日 星期一\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"148\" width=\"375\" height=\"20\"/>\n </XCUIElementTypeOther>\n </XCUIElementTypeOther>\n </XCUIElementTypeOther>\n </XCUIElementTypeOther>\n </XCUIElementTypeOther>\n </XCUIElementTypeOther>\n </XCUIElementTypeOther>\n <XCUIElementTypeTabBar type=\"XCUIElementTypeTabBar\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"729\" width=\"375\" height=\"83\">\n <XCUIElementTypeButton type=\"XCUIElementTypeButton\" value=\"1\" name=\"今天\" label=\"今天\" enabled=\"true\" visible=\"true\" x=\"2\" y=\"730\" width=\"90\" height=\"48\"/>\n <XCUIElementTypeButton type=\"XCUIElementTypeButton\" name=\"健康数据\" label=\"健康数据\" enabled=\"true\" visible=\"true\" x=\"96\" y=\"730\" width=\"90\" height=\"48\"/>\n <XCUIElementTypeButton type=\"XCUIElementTypeButton\" name=\"数据来源\" label=\"数据来源\" enabled=\"true\" visible=\"true\" x=\"190\" y=\"730\" width=\"89\" height=\"48\"/>\n <XCUIElementTypeButton type=\"XCUIElementTypeButton\" name=\"医疗急救卡\" label=\"医疗急救卡\" enabled=\"true\" visible=\"true\" x=\"283\" y=\"730\" width=\"90\" height=\"48\"/>\n </XCUIElementTypeTabBar>\n </XCUIElementTypeOther>\n </XCUIElementTypeWindow>\n <XCUIElementTypeWindow type=\"XCUIElementTypeWindow\" enabled=\"true\" visible=\"false\" x=\"0\" y=\"0\" width=\"375\" height=\"812\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"false\" x=\"0\" y=\"0\" width=\"375\" height=\"812\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"false\" x=\"0\" y=\"812\" width=\"375\" height=\"233\"/>\n </XCUIElementTypeOther>\n </XCUIElementTypeWindow>\n <XCUIElementTypeWindow type=\"XCUIElementTypeWindow\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"812\">\n <XCUIElementTypeStatusBar type=\"XCUIElementTypeStatusBar\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"44\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"44\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"375\" height=\"44\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"14\" y=\"0\" width=\"172\" height=\"29\"/>\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"true\" x=\"190\" y=\"0\" width=\"171\" height=\"29\"/>\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"false\" x=\"14\" y=\"10\" width=\"68\" height=\"19\">\n <XCUIElementTypeStaticText type=\"XCUIElementTypeStaticText\" value=\"10:56\" name=\"10:56\" label=\"10:56\" enabled=\"true\" visible=\"false\" x=\"27\" y=\"14\" width=\"42\" height=\"18\"/>\n </XCUIElementTypeOther>\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"false\" x=\"21\" y=\"8\" width=\"56\" height=\"22\"/>\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"false\" x=\"293\" y=\"10\" width=\"68\" height=\"19\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" name=\"信号强度:4(共 4 格)\" label=\"信号强度:4(共 4 格)\" enabled=\"true\" visible=\"false\" x=\"293\" y=\"17\" width=\"18\" height=\"12\"/>\n <XCUIElementTypeStaticText type=\"XCUIElementTypeStaticText\" value=\"4G\" name=\"4G\" label=\"4G\" enabled=\"true\" visible=\"false\" x=\"315\" y=\"16\" width=\"17\" height=\"15\"/>\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" value=\"正在充电\" name=\"电池电量:68%\" label=\"电池电量:68%\" enabled=\"true\" visible=\"false\" x=\"336\" y=\"17\" width=\"25\" height=\"12\"/>\n </XCUIElementTypeOther>\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"false\" x=\"293\" y=\"10\" width=\"68\" height=\"19\"/>\n </XCUIElementTypeOther>\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"false\" x=\"8\" y=\"24\" width=\"82\" height=\"14\"/>\n </XCUIElementTypeOther>\n </XCUIElementTypeStatusBar>\n </XCUIElementTypeWindow>\n</XCUIElementTypeApplication>\n"179 import json180 import requests181 jsonStr = requests.get("http://10.254.51.239:8100/source?format=json")182 jsonStr = jsonStr.text183 jsonObj = json.loads(jsonStr)184 dump = ios_dump_xml(XML, (375, 812))185 dumpJson = ios_dump_json(jsonObj["value"], (375, 812))...

Full Screen

Full Screen

test_ios.py

Source:test_ios.py Github

copy

Full Screen

...40 # 以下用例可能会因为wda更新而失败,到时候需要去掉 ios._display_info里的ipad横屏下的额外处理41 # 当ipad 在横屏+桌面的情况下,获取到的window_size的值为 height*height,没有width的值42 if self.ios.is_pad and self.client.orientation != 'PORTRAIT' and self.ios.home_interface():43 self.assertEqual(window_size.width, window_size.height)44 def test_using_ios_tagent(self):45 status = self.ios.driver.status()46 print(self.ios.using_ios_tagent)47 self.assertEqual('Version' in status, self.ios.using_ios_tagent)48 def test_snapshot(self):49 print("test_snapshot")50 filename = "./screen.png"51 if os.path.exists(filename):52 os.remove(filename)53 54 screen = self.ios.snapshot(filename=filename)55 self.assertIsInstance(screen, numpy.ndarray)56 self.assertTrue(os.path.exists(filename))57 def test_get_frames(self):58 frame = self.ios.get_frame_from_stream()...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Airtest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful