按回车键的次数不固定,怎么解决

大家好,
求助!我有一个SAP界面需要按回车键才能继续后面的操作,但是每次按回车的次数不固定,最少的时候不需要按回车,最多时需要按三次回车,请问这个怎么解决呢?谢谢!

Hi @yt.yutao

You can use the Retry scope activity to check the enter works or not.
If when you hit on enter it will show any reference element then it will help for us to click the next enter.

The retry scope has two blocks one is Action and another is Condition.
In the Action block give the Keyboard shortcuts to hit on Enter.
In the Condition block give the Element exist activity and indicate the Reference element.

Open the Retry scope activity properties, give the Number of retries as 3. we take 3 for at most hitting enters.

Hope it helps!!

Hi @yt.yutao

    Assign MaxEnterCount=3
    Assign CurrentEnterCount=0
    While  CurrentEnterCount < MaxEnterCount
        SendHotkey Key="[k(enter)]" 
        Assign CurrentEnterCount=CurrentEnterCount + 1
    While

Hope it helps!!

Hi @mkankatala

I used the Retry scope activity earlier, but it didn’t work properly. Pressing Enter for the first time worked fine, but when the conditions changed after pressing Enter for the second and third time, I added a Retry scope activity, which didn’t work. If you do not need to press Enter, an error will be reported when judging the Retry scope activity that is pressed enter for the first time.

Hi @pravallikapaluri

Like this?

@yt.yutao

Yes but the variables are of integer data type

Hi @pravallikapaluri

The operation of pressing enter is normal, but it does not continue the following action, and stays in While. May I ask what is the problem? Thank you!


image

SAP启用了脚本后,每个输入组件都有特定的ID

另外不建议使用 enter 回车来完成输入,是不是可以根据下一步 所加载页面 的特定元素是否存在,来建立子流程?

下一步还是同一个界面里,按回车只是消除状态栏上的SAP警告提示,这一步除了按回车确实没有其他操作可以替代

这个就简单了,直接在SAP logon的选项里,把 脚本告警的两个 选项去掉,


我都是把这几个notice 关闭掉的,最多在必要时 获取左下角的SAP 服务器返回信息,获取单据号之列的,UiPath 的应用组件里,有SAP专用的获取状态信息组件

我就是关掉的,按回车就是为了消除您说的那个左下角的SAP 服务器返回信息

这样的信息,需要按回车才能继续
image

这是输入了不符合要求的数据了,这种个人建议从源头解决,把输入的信息做个预处理,如果不合规的,直接跳过,是不是更好。