Ejemplo n.º 1
0
def joinandleaveroom(driver,roomid,devicename,packagename):
    suceess_flag = True
    num = 1
    elementinfo,deviceid = pubfuc.getiteminfo(driver.desired_capabilities,packagename)

    while suceess_flag:
        try:
            while num<1000:
                behavior.findroomid(driver, elementinfo, roomid)
                behavior.joinroom(driver,elementinfo)
                behavior.leaveroom(driver,elementinfo)
                num+1

        except Exception as e:
            print('error')
            #logger.error(f'第{num}次运行出错,设备是:{devicename}')
            sleep(3)
            driver.close_app()
            driver.launch_app()
Ejemplo n.º 2
0
def creatroom(driver, devicename, packagename):
    suceess_flag = True
    num = 1
    elementinfo, deviceid = pubfuc.getiteminfo(driver.desired_capabilities,
                                               packagename)

    while suceess_flag:
        try:
            behavior.choosetype(driver, elementinfo)
            while num < 1000:
                behavior.creatroom(driver, elementinfo)
                behavior.leaveroom(driver, elementinfo)
                num + 1

        except Exception as e:
            print('error')
            # logger.error(f'第{num}次运行出错,设备是:{devicename}')
            sleep(3)
            driver.close_app()
            driver.launch_app()


#def startPK