工况类型找不到时在列表循环匹配。
This commit is contained in:
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
@@ -28,7 +28,7 @@ missing module named multiprocessing.BufferTooShort - imported by multiprocessin
|
|||||||
missing module named multiprocessing.AuthenticationError - imported by multiprocessing (top-level), multiprocessing.connection (top-level)
|
missing module named multiprocessing.AuthenticationError - imported by multiprocessing (top-level), multiprocessing.connection (top-level)
|
||||||
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), zipimport (top-level)
|
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), zipimport (top-level)
|
||||||
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), zipimport (top-level)
|
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), zipimport (top-level)
|
||||||
missing module named posix - imported by os (conditional, optional), shutil (conditional), importlib._bootstrap_external (conditional), posixpath (optional)
|
missing module named posix - imported by posixpath (optional), shutil (conditional), importlib._bootstrap_external (conditional), os (conditional, optional)
|
||||||
missing module named resource - imported by posix (top-level)
|
missing module named resource - imported by posix (top-level)
|
||||||
missing module named multiprocessing.get_context - imported by multiprocessing (top-level), multiprocessing.pool (top-level), multiprocessing.managers (top-level), multiprocessing.sharedctypes (top-level)
|
missing module named multiprocessing.get_context - imported by multiprocessing (top-level), multiprocessing.pool (top-level), multiprocessing.managers (top-level), multiprocessing.sharedctypes (top-level)
|
||||||
missing module named multiprocessing.TimeoutError - imported by multiprocessing (top-level), multiprocessing.pool (top-level)
|
missing module named multiprocessing.TimeoutError - imported by multiprocessing (top-level), multiprocessing.pool (top-level)
|
||||||
|
|||||||
Binary file not shown.
BIN
dist/沉降观测自动上传.exe
vendored
BIN
dist/沉降观测自动上传.exe
vendored
Binary file not shown.
4
main.py
4
main.py
@@ -170,9 +170,9 @@ class DeviceAutomation(object):
|
|||||||
# 实现连续获取断点列表直到两次相同
|
# 实现连续获取断点列表直到两次相同
|
||||||
previous_breakpoint_list = None
|
previous_breakpoint_list = None
|
||||||
current_breakpoint_list = None
|
current_breakpoint_list = None
|
||||||
max_attempts = 10 # 最大尝试次数
|
max_attempts = 5 # 最大尝试次数
|
||||||
attempt_count = 0
|
attempt_count = 0
|
||||||
while True:
|
while attempt_count < max_attempts:
|
||||||
# 获取当前页面的断点列表
|
# 获取当前页面的断点列表
|
||||||
|
|
||||||
# 从当前页面获取断点列表名称
|
# 从当前页面获取断点列表名称
|
||||||
|
|||||||
Binary file not shown.
@@ -1024,6 +1024,31 @@ class UploadConfigPage:
|
|||||||
)
|
)
|
||||||
condition_button.click()
|
condition_button.click()
|
||||||
self.logger.info(f"成功点击{work_type_name}工况选择按钮")
|
self.logger.info(f"成功点击{work_type_name}工况选择按钮")
|
||||||
|
except TimeoutException:
|
||||||
|
self.logger.error(f"等待{work_type_name}工况选择按钮超时")
|
||||||
|
id_list = [
|
||||||
|
"com.bjjw.cjgc:id/all_point_workinfo_sp_suidao",
|
||||||
|
"com.bjjw.cjgc:id/all_point_workinfo_sp_luji",
|
||||||
|
"com.bjjw.cjgc:id/all_point_workinfo_sp_qiaoliang",
|
||||||
|
"com.bjjw.cjgc:id/all_point_workinfo_sp_handong",
|
||||||
|
]
|
||||||
|
for id in id_list:
|
||||||
|
if id == button_id:
|
||||||
|
continue
|
||||||
|
try:
|
||||||
|
self.wait.until(
|
||||||
|
EC.element_to_be_clickable((AppiumBy.ID, id))
|
||||||
|
)
|
||||||
|
self.driver.find_element(AppiumBy.ID, id).click()
|
||||||
|
self.logger.info(f"成功点击{work_type_name}其他工况选择按钮: {id}")
|
||||||
|
except TimeoutException:
|
||||||
|
self.logger.error(f"等待{work_type_name}其他工况选择按钮超时: {id}")
|
||||||
|
# return False
|
||||||
|
except Exception as e:
|
||||||
|
self.logger.error(f"点击{work_type_name}工况按钮时出错: {str(e)}")
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 检查是否有ListView,如果没有就再次点击
|
# 检查是否有ListView,如果没有就再次点击
|
||||||
try:
|
try:
|
||||||
@@ -1045,10 +1070,10 @@ class UploadConfigPage:
|
|||||||
else:
|
else:
|
||||||
self.logger.warning(f"未能为{work_type_name}选择主要工况: {workinfo_name}")
|
self.logger.warning(f"未能为{work_type_name}选择主要工况: {workinfo_name}")
|
||||||
|
|
||||||
except TimeoutException:
|
# except TimeoutException:
|
||||||
self.logger.error(f"等待{work_type_name}工况选择按钮超时")
|
# self.logger.error(f"等待{work_type_name}工况选择按钮超时")
|
||||||
except Exception as e:
|
# except Exception as e:
|
||||||
self.logger.error(f"点击{work_type_name}工况按钮时出错: {str(e)}")
|
# self.logger.error(f"点击{work_type_name}工况按钮时出错: {str(e)}")
|
||||||
|
|
||||||
# 第二步:如果有次要工况,滑动页面处理
|
# 第二步:如果有次要工况,滑动页面处理
|
||||||
if minor_conditions_list:
|
if minor_conditions_list:
|
||||||
|
|||||||
Reference in New Issue
Block a user