gpt4 book ai didi

java - 由于存在粘性按钮而无法单击按钮

转载 作者:行者123 更新时间:2023-11-30 00:13:25 25 4
gpt4 key购买 nike

由于存在粘性聊天按钮,我无法在我的 Appium 测试中点击屏幕上的按钮。谁能帮忙?

代码

public static void TapViewBookingButton() throws InterruptedException 
{
Setup.startTimer();
MobileElement btnViewBooking = (MobileElement) Setup.wait.until(ExpectedConditions.presenceOfElementLocated(By.id(btnViewBooking_ID)));
btnViewBooking.click();
Setup.updateLogMessage("VIEW BOOKING button clicked in " + Setup.stopTimer(Setup.stopWatch), SM_CONSTANTS.isScreenshot);
}

buttonViewBooking.Click() - (VIEW BOOKING) 由于屏幕右下角显示的粘性在线聊天粘性按钮无法正常工作,如图所示

enter image description here

日志:

info: --> POST /wd/hub/session/7ee1afc3-9a7c-4105-b8e9-acdbf9570f46/elements {"using":"id","value":"com.servicemarket.app.debug:id/btnViewBooking"} info: [debug] Waiting up to 0ms for condition info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"com.servicemarket.app.debug:id/btnViewBooking","context":"","multiple":true}] info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.servicemarket.app.debug:id/btnViewBooking","context":"","multiple":true}} info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION info: [debug] [BOOTSTRAP] [debug] Got command action: find info: [debug] [BOOTSTRAP] [debug] Finding com.servicemarket.app.debug:id/btnViewBooking using ID with the contextId: multiple: true info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[RESOURCE_ID=com.servicemarket.app.debug:id/btnViewBooking] info: [debug] [BOOTSTRAP] [debug] getElements selector:UiSelector[RESOURCE_ID=com.servicemarket.app.debug:id/btnViewBooking] info: [debug] [BOOTSTRAP] [debug] Element[] is null: (0) info: [debug] [BOOTSTRAP] [debug] getElements tmp selector:UiSelector[INSTANCE=0, RESOURCE_ID=com.servicemarket.app.debug:id/btnViewBooking] info: [debug] [BOOTSTRAP] [debug] Element[] is null: (1) info: [debug] [BOOTSTRAP] [debug] getElements tmp selector:UiSelector[INSTANCE=1, RESOURCE_ID=com.servicemarket.app.debug:id/btnViewBooking] info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":[{"ELEMENT":"126"}],"status":0} info: [debug] Responding to client with success: {"status":0,"value":[{"ELEMENT":"126"}],"sessionId":"7ee1afc3-9a7c-4105-b8e9-acdbf9570f46"} info: <-- POST /wd/hub/session/7ee1afc3-9a7c-4105-b8e9-acdbf9570f46/elements 200 36.010 ms - 91 {"status":0,"value":[{"ELEMENT":"126"}],"sessionId":"7ee1afc3-9a7c-4105-b8e9-acdbf9570f46"} info: --> POST /wd/hub/session/7ee1afc3-9a7c-4105-b8e9-acdbf9570f46/element/126/click {"id":"126"} info: [debug] Pushing command to appium work queue: ["element:click",{"elementId":"126"}] info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:click","params":{"elementId":"126"}} info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION info: [debug] [BOOTSTRAP] [debug] Got command action: click info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0} info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"7ee1afc3-9a7c-4105-b8e9-acdbf9570f46"} info: <-- POST /wd/hub/session/7ee1afc3-9a7c-4105-b8e9-acdbf9570f46/element/126/click 200 306.260 ms - 76 {"status":0,"value":true,"sessionId":"7ee1afc3-9a7c-4105-b8e9-acdbf9570f46"}

最佳答案

这样就可以获取元素了。那已经很好了。尝试使用 TouchAction 点击,例如按下longPress:

Point point = btnViewBooking.getLocation();
new TouchAction(driver)
.longPress(point.getX(), point.getY())
.release()
.perform();

关于java - 由于存在粘性按钮而无法单击按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47752514/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com