Test method, device and equipment for cloud mobile phone synchronizer and medium

Through automated testing methods, the interfaces and selenium libraries of cloud mobile phone manufacturers are used to achieve fast and accurate testing of cloud mobile phone synchronizers, solving the problems of cumbersome and inefficient existing testing processes.

CN119892677APending Publication Date: 2025-04-25ZIXUN TECHNOLOGY (FUJIAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510034148.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-09
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The test process of existing cloud mobile synchronizers is cumbersome, time-consuming, inefficient, and testers are prone to fatigue when running at high concurrency, resulting in inaccurate test results.

Method used

It provides an automated testing method, through the creation of instances, booting and deleting instance interfaces of cloud mobile phone manufacturers, combined with the third-party selenium library, it realizes automated testing of cloud mobile phone synchronizer, including setting up master-slave control windows, simulate synchronization operations and screenshot saving.

Benefits of technology

It greatly reduces the testing time and labor costs, improves the testing efficiency, and ensures the accuracy and reliability of the test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119892677A_ABST
    Figure CN119892677A_ABST
Patent Text Reader

Abstract

The invention provides a test method, device and equipment for a cloud mobile phone synchronizer and a medium, and the method comprises the steps: creating a plurality of cloud mobile phone examples through an example interface of a cloud mobile phone manufacturer, calling a starting interface of the cloud mobile phone manufacturer for starting according to an example ID, obtaining information of a cloud mobile phone according to the example ID, and starting the cloud mobile phone according to the information. Generating a JOSN file from the obtained information and the instance ID according to a JOSN format, and storing the JOSN file locally; a test page of a cloud mobile phone synchronizer is opened, and the JOSN file is imported into a local cache of a browser; setting a master control window and a slave control window of the cloud mobile phone on the test page, and simulating and clicking a start synchronization button; in the master control window, simulating operation of a user through a selenium library, performing screenshot after execution each time, and storing the screenshot in a local folder; the cloud mobile phone synchronizer is automatically tested, and a tester obtains a test result according to the screenshot.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field, and in particular to a testing method, device, equipment and medium for a cloud phone synchronizer. Background Art

[0002] The existing cloud phone synchronizer is implemented through WEB technology; the traditional test process of the cloud phone synchronizer is: create multiple cloud phone instances - turn on in sequence - set up master and slave machines - test in the main control window - record test results - shut down in sequence - delete the created cloud phone instances. Only through such a long process can the cloud phone synchronizer be tested.

[0003] The disadvantages of the existing technology are: the entire test process includes multiple steps such as creating an instance, starting up, setting up the master and slave machines, testing, recording results, shutting down and deleting instances, which is time-consuming and inefficient, requiring a lot of time and human resources, affecting the efficiency and accuracy of the test. When running at high concurrency, the tester must observe the status of each cloud phone and check the performance status of the server, which requires the tester to concentrate highly. If the test is long-term, the tester is prone to fatigue, resulting in the possibility of inaccurate test results. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a testing method, device, equipment and medium for a cloud phone synchronizer, which can automatically perform testing, greatly improve testing efficiency, save test results, and enable testers to perform test analysis based on the test results.

[0005] In a first aspect, the present invention provides a testing method for a cloud phone synchronizer, comprising the following steps:

[0006] Step 1: Use the instance creation interface of the cloud phone manufacturer to create multiple cloud phone instances, and save the multiple instance IDs obtained locally;

[0007] Step 2: Call the cloud phone manufacturer's startup interface based on the locally stored instance ID and wait for the cloud phone startup callback to succeed;

[0008] Step 3: After the cloud phone is successfully started, the cloud phone information is obtained according to the instance ID, including the remote link and token, and the obtained information and instance ID are used to generate a JOSN file in JOSN format and saved locally;

[0009] Step 4: Call the third-party selenium library, open the test page of the cloud phone synchronizer, and import the JOSN file into the local cache localstorage of the browser by calling the set js instruction;

[0010] Step 5: Set the master control window and slave control window of the cloud phone on the test page through the click operation of the selenium library. The master control window and the slave control window are tiled on the screen, and simulate clicking the start synchronization button;

[0011] Step 6. In the master control window, the selenium library is used to simulate the user's operation. The cloud phone synchronizer synchronizes the operation to each slave control window, takes a screenshot after each execution, and saves it to a local folder.

[0012] Step 7. After the set simulation operation is completed, restore the cloud phone to its initial state. According to the instance ID, call the cloud phone manufacturer's shutdown interface and instance deletion interface; shut down the cloud phone and delete the cloud phone instance.

[0013] In a second aspect, the present invention provides a testing device for a cloud phone synchronizer, comprising:

[0014] Create an instance module, create multiple cloud phone instances through the instance creation interface of the cloud phone manufacturer, and save the multiple instance IDs obtained locally;

[0015] The startup module calls the startup interface of the cloud phone manufacturer according to the locally stored instance ID and waits for the cloud phone startup callback to succeed;

[0016] The information acquisition module obtains the information of the cloud phone according to the instance ID after the cloud phone is successfully started up. The information includes: remote link and token. The obtained information and instance ID are used to generate a JOSN file in JOSN format and saved locally.

[0017] Import the browser module, call the third-party selenium library, open the test page of the cloud phone synchronizer, and import the JOSN file into the local cache localstorage of the browser by calling the set js instruction;

[0018] Open the synchronization module, set the master control window and slave control window of the cloud phone on the test page through the click operation of the selenium library, the master control window and the slave control window are tiled on the screen, and simulate clicking the start synchronization button;

[0019] The operation screenshot module simulates the user's operation in the main control window through the selenium library. The cloud phone synchronizer synchronizes the operation to each slave control window, takes a screenshot after each execution, and saves it to a local folder.

[0020] The shutdown and restore module restores the cloud phone to its initial state after the set simulation operation is completed. According to the instance ID, the shutdown interface and instance deletion interface of the cloud phone manufacturer are called; the cloud phone is shut down and the cloud phone instance is deleted.

[0021] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect when executing the program.

[0022] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.

[0023] One or more technical solutions provided by the present invention have at least the following technical effects or advantages:

[0024] The present invention can significantly reduce time and labor costs, and can improve the efficiency of testers whether it is functional testing or regression testing, and reduces cumbersome operations such as frequent manual creation of a large number of instances and batch startup / shutdown.

[0025] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.

[0027] Figure 1 is a flow chart of the method in Embodiment 1 of the present invention;

[0028] Figure 2 It is a schematic diagram of the structure of the device in the second embodiment of the present invention. DETAILED DESCRIPTION

[0029] The technical solution in the embodiment of the present application has the following general idea:

[0030] Step 1: Use the instance creation interface provided by the cloud phone manufacturer to batch create cloud phone instances and save the obtained cloud phone instance ID locally; the python script calls the interface to generate mobile phone instances. The number of calls determines the number of cloud phone instances generated; the cloud phone manufacturer will return the corresponding cloud phone instance ID;

[0031] Step 2: Call the startup interface of the cloud phone instance in batches according to the instance ID stored locally, and wait for the cloud phone startup callback to succeed; the python script calls the startup interface through the instance ID to start the phone, the cloud phone manufacturer's server starts the phone, and returns the cloud phone startup status;

[0032] Step 3: After the cloud phone is successfully started, the cloud phone information is obtained according to the instance ID, such as remote link, token, etc., and the obtained information and instance ID are saved in a local file in JOSN format;

[0033] Step 4: Call the third-party selenium library, open the test page of the cloud phone synchronizer, and import the cloud phone json information obtained in step 3 into localstorage (local cache of the browser) by calling js instructions;

[0034] Step 5: On the test page, use the click operation of the selenium library to automatically set the master and slave control windows of the cloud phone, and click to start synchronization;

[0035] Step 6: In the cloud phone main control window, the selenium library is used to automatically simulate the user's click, drag, long press and other operations, and a screenshot is taken after each execution and saved to a local folder, so that after the test is completed, the cloud phone synchronizer can be checked for synchronization anomalies;

[0036] Step 7: After the specified simulation operation is completed, you need to clean up the data and restore the cloud phone to its initial state. At this time, you need to call the cloud phone manufacturer's cloud phone shutdown interface and the instance deletion interface in batches according to the previously saved instance ID. At this point, the test of the cloud phone synchronizer is completed. You can check the screenshots in the folder to determine whether the cloud phone has synchronization anomalies.

[0037] The following is the Python core code:

[0038] importrequests,json,psutil,os,time,hashlib

[0039] importtime

[0040] #Create a cloud phone instance

[0041] defcreatePhone(number):

[0042] json_list=[]#Initialize an empty list to store cloud phone information

[0043] foriinrange(0,number):#Loop to create a specified number of cloud phone instances

[0044] url='https: / / '+params["host"]+' / api / openApi / openapi / abilit y / envir / add'#API URL

[0045] data = body_data #data to be sent, body_data variable needs to be defined externally

[0046] heads={'Content-Type':'application / json','ts':strtime,'traceId':params["traceId"],'appId':params["appIdTestHub"],'noce':params["noce"],'sign':getShaSign()}

[0047] response = requests.post (url, data = data, headers = heads) # Send POST request

[0048] print(response.text)

[0049] envirId=json.loads(response.text).get("rows")[0].get("envirIdList")[0]#Parse the response result to get the instance ID

[0050] with open(os.getcwd()+r'\envids.txt','a')as file:#Write the instance ID to the file

[0051] file.write(str(envirId)+'\n')

[0052] startPhone(str(envirId))#Call function to start cloud phone

[0053] print("----------------------------------")

[0054] getUrlRes = getUrl(str(envirId))#Get the remote connection information of the cloud phone

[0055] frontToken = getUrlRes.get("rows")[0].get("frontToken") # Get frontToken

[0056] link = getUrlRes.get("rows")[0].get("link") # Get the URL of the remote connection

[0057] # Set different cloud phone names according to different URLs

[0058] if "serialno" in link:

[0059] name = "Yibo"

[0060] elif "huawei" in link:

[0061] name = "Huawei"

[0062] link = link.replace("hubstudio", "test", 1)

[0063] elif "bytedance" in link:

[0064] name = "Volcano"

[0065] else:

[0066] name = "Baidu"

[0067] # Construct a dictionary of cloud phone information

[0068] json_data = {

[0069] "name": name + " Cloud Phone - " + str(envirId),

[0070] "url": link,

[0071] "envirId": str(envirId),

[0072] "frontToken": frontToken,

[0073] "key": int(frontToken)

[0074] }

[0075] json_list.append(json_data) # Add the dictionary to the list

[0076] with open(os.getcwd()+r'\cloud_phone_json.json','w')as file:#Write cloud phone information into JSON file

[0077] file.write(str(json.dumps(json_list)))

[0078] #Get mobile phone information based on instance id

[0079] defgetPhoneInfo(envirId):

[0080] url='https: / / '+params["host"]+' / api / openApi / openapi / ability / hw / phone / info'#API URL

[0081] data='{"envirId":"'+envirId+'"}'

[0082] heads={'Content-Type':'application / json','ts':strtime,'traceId':params["traceId"],'appId':params["appIdTestHub"],'noce':params["noce"],'sign':getShaSign()}

[0083] response = requests.post (url, data = data, headers = heads) # Send POST request

[0084] print(response.text)

[0085] returnjson.loads(response.text)#Returns the parsed JSON data

[0086] #Start the machine according to the instance id

[0087] defstartPhone(envirId):

[0088] url='https: / / '+params["host"]+' / api / openApi / openapi / ability / env ir / start'

[0089] data="{"data":{"envirId":"'+envirId+'"}}'

[0090] heads={'Content-Type':'application / json','ts':strtime,'traceId':params["traceId"],'appId':params["appIdTestHub"],'noce':params["noce"],'sign':getShaSign()}

[0091] response = requests.post (url, data = data, headers = heads) # Send POST request

[0092] print("Power-on result {}".format(response.text))

[0093] #Get the remote link based on the instance id

[0094] defgetUrl(envirId):

[0095] url='https: / / '+params["host"]+' / api / openApi / openapi / ability / env ir / remote / link'

[0096] data="{"data":{"envirId":"'+envirId+'"}}'

[0097] heads={'Content-Type':'application / json','ts':strtime,'traceId':params["traceId"],'appId':params["appIdTestHub"],'noce':params["noce"],'sign':getShaSign()}

[0098] response = requests.post (url, data = data, headers = heads) # Send POST request

[0099] print("remote connection result {}".format(response.text))#Print remote connection result

[0100] returnjson.loads(response.text)#Returns the parsed JSON data

[0101] #Save cloud phone information to json

[0102] defsaveCloudPhoneJson(envid):

[0103] json_list=[]#Initialize an empty list to store cloud phone information

[0104] foriin envid:#Loop through each instance ID

[0105] getUrlRes = getUrl(str(i)) # Get the remote connection information of the cloud phone

[0106] frontToken=getUrlRes.get("rows")[0].get("frontToken")#Get frontToken

[0107] link=getUrlRes.get("rows")[0].get("link")#Get the URL of the remote connection

[0108] #Set different cloud phone names according to different URLs

[0109] if "serialno" in link:

[0110] name="EasyPlay"

[0111] elif "huawei" in link:

[0112] name="Huawei"

[0113] link=link.replace("hubstudio","test",1)#Modify URL

[0114] elif "bytedance" in link:

[0115] name="Volcano"

[0116] else:

[0117] name="Baidu"

[0118] #Build a dictionary of cloud phone information

[0119] json_data={

[0120] "name": name + " Cloud Machine - " + str(i),

[0121] "url": link,

[0122] "envirId": str(i),

[0123] "frontToken": frontToken,

[0124] "key": int(frontToken)

[0125] }

[0126] json_list.append(json_data) # Add the dictionary to the list

[0127] with open(os.getcwd() + r'\cloud_phone_json.json', 'w') as file: # Write the cloud phone information to a JSON file

[0128] file.write(str(json.dumps(json_list)))

[0129] # Close the cloud phone

[0130] def closePhone(envirId):

[0131] url = 'https: / / ' + params["host"] + ' / api / openApi / openapi / ability / envir / stop'

[0132] data = '{"data": {"envirId": "' + envirId + '"}}'

[0133] heads = {'Content-Type': 'application / json', 'ts': strtime, 'traceId': params["traceId"], 'appId': params["appIdTestHub"], 'noce': params["noce"],'sign': getShaSign()}

[0134] response = requests.post(url, data=data, headers=heads) # Send a POST request

[0135] print("Shutdown result {}".format(response.text))

[0136] #Delete Cloud Phone

[0137] defdelPhone(envirId):

[0138] url='https: / / '+params["host"]+' / api / openApi / openapi / ability / env ir / del'

[0139] data="{"data":{"envirId":"'+envirId+'"}}'

[0140] heads={'Content-Type':'application / json','ts':strtime,'traceId':params["traceId"],'appId':params["appIdTestHub"],'noce':params["noce"],'sign':getShaSign()}

[0141] response = requests.post (url, data = data, headers = heads) # Send POST request

[0142] print("Delete environment result {}".format(response.text))#Print the result of deleting the environment

[0143] #screenshot

[0144] defscreenShot():

[0145] import ctypes#Import ctypes library for calling Windows API

[0146] importinspect#Import the inspect library to obtain information about the calling function

[0147] from PIL import ImageGrab#Import the ImageGrab module of the PIL library for screenshots

[0148] caller_frame=inspect.currentframe().f_back

[0149] caller_info=inspect.getframeinfo(caller_frame)

[0150] caller_name=caller_info.function

[0151] importdatetime#Import the datetime library to get the current time

[0152] current_time=datetime.datetime.now()#Get the current time

[0153] formatted_time = current_time.strftime("%Y-%m-%d-%H%M%S") # formatted time

[0154] name=formatted_time+"_"+caller_name#The name of the screenshot is the current time + the name of the calling function

[0155] time.sleep(1)#Wait a few seconds before taking a screenshot to ensure the webpage is loaded normally

[0156] #Simulate pressing the "Screenshot" key

[0157] VK_SNAPSHOT = 0x2C

[0158] ctypes.windll.user32.keybd_event(VK_SNAPSHOT,0,0,0)

[0159] time.sleep(1)#Wait for a while to make sure the screen has been captured

[0160] #Save screenshot

[0161] img=ImageGrab.grabclipboard()

[0162] Path = os.path.abspath(os.path.join(os.getcwd()))#Get the current running path

[0163] folder_name=Path+r" / screenshot"#Define the folder path where the screenshots are saved

[0164] ifnotos.path.exists(folder_name):#If the folder does not exist, create it

[0165] os.makedirs(folder_name)

[0166] ifimg is notNone:#If the screenshot is successful, save the image

[0167] pic=folder_name+r" / "+name+"_screenshot.png"

[0168] img.save(pic)#Save picture

[0169] with open(pic,mode='rb')as f:

[0170] file=f.read()#Read image file

[0171] else:

[0172] print("No screenshot")

[0173] defrun():

[0174] from selenium importwebdriver#Import selenium's webdriver module from selenium.webdriver.common.byimportBy#Import By module for locating elements

[0175] importjson#Import json module to process JSON data

[0176] from selenium.webdriver.chrome.options import Options#Import Chrome options module

[0177] from selenium.webdriver.common.action_chains import ActionChains#Import the ActionChains module to perform complex user operations

[0178] from selenium.webdriver.support.uiimport Select#Import the Select module to operate the drop-down menu

[0179] importtime#Import the time module for waiting operations

[0180] chrome_options = Options() #Create a Chrome options object

[0181] chrome_options.add_experimental_option("detach",True)#Set options to keep the browser open

[0182] #Start the browser

[0183] driver=webdriver.Chrome(options=chrome_options)

[0184] #Open the webpage

[0185] driver.get(url)#Open the specified URL

[0186] driver.maximize_window()#Maximize the browser window

[0187] #File path

[0188] file_path=file#define file path variable

[0189] try:

[0190] withopen(file_path,'r',encoding='utf-8')as file:#Try to open the file

[0191] data = json.dumps((json.load(file)))#Read and parse JSON data

[0192] print(data)#print data

[0193] exceptFileNotFoundError: #If the file does not exist

[0194] print(f"File not found:{file_path}")#Print error message

[0195] exceptjson.JSONDecodeError: #If JSON parsing error

[0196] print(f"Error decoding JSON from file:{file_path}")#Print error information

[0197] #Setting up localStorage

[0198] script1="""

[0199] window.localStorage.setItem('ga3-player-url-list','{}');

[0200] """.format(data)

[0201] script2 = "history.go(0)"

[0202] driver.execute_script(script1)#Execute JavaScript script

[0203] driver.execute_script(script2)#Execute JavaScript script

[0204] main_dropdown = driver.find_element(By.XPATH,' / / [@id="synchr onizer-sync"] / div[1] / section / div[1] / div[2] / div / span')#Locate the drop-down menu

[0205] select=Select(main_dropdown)#Create a Select object

[0206] select.select_by_index(0)#Select the second option (index starts at 0)

[0207] other = driver.find_element(By.XPATH,' / / [@id="synchronizer-sync"] / div[1] / section / div[1] / div[3] / div / div / div')#locate another drop-down menu

[0208] select=Select(other)#Create a Select object

[0209] select.select_by_index(1)#Select the second option (index starts at 0)

[0210] driver.find_element(By.XPATH,

[0211] ' / / [@id="synchronizer-sync"] / div[1] / section / div[4] / div / div[1] / button').click()#Click the button

[0212] time.sleep(3)#wait for 3 seconds

[0213] drag = driver.find_element (By.XPATH, ' / / [@id = "57173f7c-be66-4701-a177-0a2d15d528f0"] / video') # Locate the video element

[0214] action = ActionChains (driver) # Create an ActionChains object

[0215] action.click_and_hold(drag).move_by_offset(X,Y).release().perform()#Perform drag operation

[0216] screenShot()#Call screenshot function

[0217] time.sleep(5)#wait for 5 seconds

[0218] Embodiment 1

[0219] like Figure 1 As shown, this embodiment provides a testing method for a cloud phone synchronizer, comprising the following steps:

[0220] Step 1: Use the instance creation interface of the cloud phone manufacturer to create multiple cloud phone instances, and save the multiple instance IDs obtained locally;

[0221] Step 2: Call the cloud phone manufacturer's startup interface based on the locally stored instance ID and wait for the cloud phone startup callback to succeed;

[0222] Step 3: After the cloud phone is successfully started, the cloud phone information is obtained according to the instance ID, including the remote link and token, and the obtained information and instance ID are used to generate a JOSN file in JOSN format and saved locally;

[0223] Step 4: Call the third-party selenium library, open the test page of the cloud phone synchronizer, and import the JOSN file into the local cache localstorage of the browser by calling the set js instruction;

[0224] Step 5: Set the master control window and slave control window of the cloud phone on the test page through the click operation of the selenium library. The master control window and the slave control window are tiled on the screen, and simulate clicking the start synchronization button;

[0225] Step 6. In the master control window, the selenium library is used to simulate the user's operation. The cloud phone synchronizer synchronizes the operation to each slave control window, takes a screenshot after each execution, and saves it to a local folder.

[0226] Step 7. After the set simulation operation is completed, restore the cloud phone to its initial state. According to the instance ID, call the cloud phone manufacturer's shutdown interface and instance deletion interface; shut down the cloud phone and delete the cloud phone instance.

[0227] In this embodiment, preferably, step 5 is specifically: through the click operation of the selenium library, the main control window and the slave control window of the cloud phone are set on the test page, the main control window and the slave control window are tiled on the screen, and the click of the start synchronization button is simulated, and the screen also includes a performance monitor of the cloud phone server.

[0228] In this embodiment, preferably, step 6 is specifically as follows: in the main control window, the user's operation is simulated through the selenium library, the cloud phone synchronizer synchronizes the operation to each slave control window, and a screenshot is taken after the first waiting set time. The name of the screenshot includes the current time and the calling function, and the screenshot is saved in a local folder after the second set time.

[0229] This embodiment preferably further includes step 8, opening the local folder for the tester to view the screenshots.

[0230] Based on the same inventive concept, the present application also provides a device corresponding to the method in Example 1, see Example 2 for details.

[0231] Embodiment 2

[0232] like Figure 2 As shown, in this embodiment, a testing device for a cloud phone synchronizer is provided, including:

[0233] Create an instance module, create multiple cloud phone instances through the instance creation interface of the cloud phone manufacturer, and save the multiple instance IDs obtained locally;

[0234] The startup module calls the startup interface of the cloud phone manufacturer according to the locally stored instance ID and waits for the cloud phone startup callback to succeed;

[0235] The information acquisition module obtains the information of the cloud phone according to the instance ID after the cloud phone is successfully started up. The information includes: remote link and token. The obtained information and instance ID are used to generate a JOSN file in JOSN format and saved locally.

[0236] Import the browser module, call the third-party selenium library, open the test page of the cloud phone synchronizer, and import the JOSN file into the local cache localstorage of the browser by calling the set js instruction;

[0237] Open the synchronization module, set the master control window and slave control window of the cloud phone on the test page through the click operation of the selenium library, the master control window and the slave control window are tiled on the screen, and simulate clicking the start synchronization button;

[0238] The operation screenshot module simulates the user's operation in the main control window through the selenium library. The cloud phone synchronizer synchronizes the operation to each slave control window, takes a screenshot after each execution, and saves it to a local folder.

[0239] The shutdown and restore module restores the cloud phone to its initial state after the set simulation operation is completed. According to the instance ID, the shutdown interface and instance deletion interface of the cloud phone manufacturer are called; the cloud phone is shut down and the cloud phone instance is deleted.

[0240] In this embodiment, preferably, the synchronization module is started specifically by: setting the main control window and the slave control window of the cloud phone on the test page through the click operation of the selenium library, the main control window and the slave control window are tiled on the screen, and simulate clicking the start synchronization button, and the screen also includes a performance monitor of the cloud phone server.

[0241] In this embodiment, preferably, the operation screenshot module is specifically as follows: in the main control window, the user's operation is simulated through the selenium library, the cloud phone synchronizer synchronizes the operation to each slave control window, and a screenshot is taken after a first waiting set time. The name of the screenshot includes the current time and the calling function, and the screenshot is saved in a local folder after a second set time.

[0242] This embodiment preferably also includes a display module to open the local folder for the tester to view the screenshots.

[0243] Since the device introduced in the second embodiment of the present invention is a device used to implement the method of the first embodiment of the present invention, those skilled in the art can understand the specific structure and deformation of the device based on the method introduced in the first embodiment of the present invention, so it is not described here in detail. All devices used in the method of the first embodiment of the present invention belong to the scope of protection of the present invention.

[0244] Based on the same inventive concept, the present application provides an electronic device embodiment corresponding to the first embodiment, see the third embodiment for details.

[0245] Embodiment 3

[0246] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any implementation method in the first embodiment can be implemented.

[0247] Since the electronic device introduced in this embodiment is a device used to implement the method in the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, a person skilled in the art can understand the specific implementation of the electronic device of the present embodiment and its various variations, so how the electronic device implements the method in the embodiment of the present application is not described in detail here. As long as a person skilled in the art implements the device used by the method in the embodiment of the present application, it belongs to the scope of protection of the present application.

[0248] Based on the same inventive concept, the present application provides a storage medium corresponding to the first embodiment, see the fourth embodiment for details.

[0249] Embodiment 4

[0250] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, any implementation method in the first embodiment can be implemented.

[0251] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0252] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0253] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0254] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0255] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.

Claims

1. A testing method for a cloud phone synchronizer, characterized in that: The steps include: Step 1: Use the instance creation interface of the cloud phone manufacturer to create multiple cloud phone instances, and save the multiple instance IDs obtained locally; Step 2: Call the cloud phone manufacturer's startup interface based on the locally stored instance ID and wait for the cloud phone startup callback to succeed; Step 3: After the cloud phone is successfully started, the cloud phone information is obtained according to the instance ID, including the remote link and token, and the obtained information and instance ID are used to generate a JOSN file in JOSN format and saved locally; Step 4: Call the third-party selenium library, open the test page of the cloud phone synchronizer, and import the JOSN file into the local cache localstorage of the browser by calling the set js instruction; Step 5: Set the master control window and slave control window of the cloud phone on the test page through the click operation of the selenium library. The master control window and the slave control window are tiled on the screen, and simulate clicking the start synchronization button; Step 6. In the master control window, the selenium library is used to simulate the user's operation. The cloud phone synchronizer synchronizes the operation to each slave control window, takes a screenshot after each execution, and saves it to a local folder. Step 7. After the set simulation operation is completed, restore the cloud phone to its initial state. According to the instance ID, call the cloud phone manufacturer's shutdown interface and instance deletion interface; shut down the cloud phone and delete the cloud phone instance.

2. A test method for a cloud phone synchronizer according to claim 1, characterized in that: The step 5 is specifically as follows: through the click operation of the selenium library, the main control window and the slave control window of the cloud phone are set on the test page, the main control window and the slave control window are tiled on the screen, and a click on the start synchronization button is simulated, and the screen also includes a performance monitor of the cloud phone server.

3. A test method for a cloud phone synchronizer according to claim 1, characterized in that: The specific steps of step 6 are as follows: in the main control window, the user's operation is simulated through the selenium library, and the cloud phone synchronizer synchronizes the operation to each slave control window, and a screenshot is taken after the first waiting set time. The name of the screenshot includes the current time and the calling function, and the screenshot is saved in a local folder after the second set time.

4. A test method for a cloud phone synchronizer according to claim 1, characterized in that: The method also includes step 8 of opening the local folder for the tester to view the screenshots.

5. A test device for a cloud phone synchronizer, characterized in that: include: Create an instance module, create multiple cloud phone instances through the instance creation interface of the cloud phone manufacturer, and save the multiple instance IDs obtained locally; The startup module calls the startup interface of the cloud phone manufacturer according to the locally stored instance ID and waits for the cloud phone startup callback to succeed; The information acquisition module obtains the information of the cloud phone according to the instance ID after the cloud phone is successfully started up. The information includes: remote link and token. The obtained information and instance ID are used to generate a JOSN file in JOSN format and saved locally. Import the browser module, call the third-party selenium library, open the test page of the cloud phone synchronizer, and import the JOSN file into the local cache localstorage of the browser by calling the set js instruction; Open the synchronization module, set the master control window and slave control window of the cloud phone on the test page through the click operation of the selenium library, the master control window and the slave control window are tiled on the screen, and simulate clicking the start synchronization button; The operation screenshot module simulates the user's operation in the main control window through the selenium library. The cloud phone synchronizer synchronizes the operation to each slave control window, takes a screenshot after each execution, and saves it to a local folder. The shutdown and restore module restores the cloud phone to its initial state after the set simulation operation is completed. According to the instance ID, the shutdown interface and instance deletion interface of the cloud phone manufacturer are called; the cloud phone is shut down and the cloud phone instance is deleted.

6. A test device for a cloud phone synchronizer according to claim 5, characterized in that: The specific method of starting the synchronization module is: through the click operation of the selenium library, the main control window and the slave control window of the cloud phone are set on the test page, the main control window and the slave control window are tiled on the screen, and a click on the start synchronization button is simulated. The screen also includes a performance monitor of the cloud phone server.

7. A test device for a cloud phone synchronizer according to claim 5, characterized in that: The operation screenshot module is specifically as follows: in the main control window, the user's operation is simulated through the selenium library, and the cloud phone synchronizer synchronizes the operation to each slave control window, and a screenshot is taken after the first waiting set time. The name of the screenshot includes the current time and the calling function, and the screenshot is saved in a local folder after the second set time.

8. A test device for a cloud phone synchronizer according to claim 5, characterized in that: It also includes a display module, which opens the local folder for testers to view the screenshots.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 4 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.