Using xamarin language to test software element on appcenter

时间:2018-12-03 12:54:07

标签: xamarin testing automation uitest

Currently I am using xamarin to test a software running on HTC Android Phone 6.0.1. As for the numberpicker input, I have a problem, that is not working on the Set button to save the month. The ways I used to affect the set button:

app.tap̣ (x => x.Id ("button1")); 

With button1 is the id of the Set nut

app.tap (x => x.Text ("Set")); 

Set is the value of the button's text property

app.TapCoordinates (230,400) 

with 230 and 400 are the x and y values of the Set button What should I do next? Thank you all for your comments

1 个答案:

答案 0 :(得分:0)

尝试

for i in range(0, num_frames):
rects = []
#Get the very first image from the video
if (first_iteration == 1):
    ret, frame = cap.read()
    frame = cv2.resize(frame, (imageHight,imageWidth))
    first_frame = copy.deepcopy(frame)
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    height, width = frame.shape[:2]
    print("shape:", height,width)
    first_iteration = 0

else:
    ret, frame = cap.read()
    frame = cv2.resize(frame, (imageHight,imageWidth))
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

    forgroundMask = backgroundSub.apply(frame)

    #Get contor for each person
    _, contours, _ = cv2.findContours(forgroundMask.copy(),cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE)
    contours = filter(lambda cont: cv2.contourArea(cont) > 20, contours)
    #Get bbox from the controus
    for c in contours:
        (x, y, w, h) = cv2.boundingRect(c)
        rectangle = [x, y, (x + w), (y + h)]
        rects.append(rectangle)
        cv2.rectangle(frame, (rectangle[0], rectangle[1]), (rectangle[2], rectangle[3]),
                      (0, 255, 0), 2)

    objects = ct.update(rects)

    for (objectID, centroid) in objects.items():
        text = "ID:{}".format(objectID)
        cv2.putText(frame, text, (centroid[0] - 10, centroid[1] - 10),
                    cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2)
        cv2.circle(frame, (centroid[0], centroid[1]), 4, (0, 255, 0), -1)


    '''Display Windows'''
    cv2.imshow('FGMask', forgroundMask)
    frame1 = frame.copy()
    cv2.imshow('MOG', frame1)
cv2.imshow('frame', frame)



if cv2.waitKey(1) & 0xFF == ord('q'):
    break