You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

ACS自动化登录脚本异常:第二次登录部分注入代码执行被跳过求助

ACS自动化脚本二次登录时send_keys(username/password)被跳过问题

这是针对Access Client Solutions(ACS)的自动化应用,Python脚本运行时无故跳过部分代码。

关于ACS登录,需进行两次验证尝试:首次登录代码执行正常,但第二次登录时,ky.send_keys(username)和ky.send_keys(password)这两行注入代码被跳过,而{TAB}和{ENTER}命令可正常执行。值得注意的是,该双登录功能此前在SIT环境中可正常运行,且两次登录的代码逻辑完全一致,目前无法明确代码被跳过的原因。

print("Injection Starting")
try:
    ky.send_keys(username)
    time.sleep(2)
    ky.send_keys("{TAB}") 
    ky.send_keys(password)
    time.sleep(2)
    ky.send_keys("{ENTER}")
except Exception as e:
    print(f"Error during first injection: {str(e)}") #f-string with expression with {}.

print("Second Injection Starting")
try:
    ky.send_keys(username)    #somehow this is being skipped.
    time.sleep(3)
    ky.send_keys("{TAB}")     #but this part it worked.
    ky.send_keys(password)    #again, this is being skipped.
    time.sleep(3)
    ky.send_keys("{ENTER}")   #and this part it worked.
    time.sleep(3)
except Exception as e:
    print(f"Error during second injection: {str(e)}")

请问有人遇到过此类问题吗?我接下来打算尝试替换为pyautogui,但对其有效性存疑,十分费解。

感谢!

内容的提问来源于stack exchange,提问作者GrootLuie

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.18 06:13:25