cancel
Showing results for 
Search instead for 
Did you mean: 

Help with scripting needed

Former Member
0 Kudos

Hi, i have questions regarding scripting in transaction ABAW second screen when we post some new amount for the first time to the asset after pressing Enter we have to confirm 3 pop-up windows in a row, and we would like to do that with the script. We tried to do with the if and source .visible parameter where inside confirm button is pressed 3 times.

It work for the first time after we press Enter, but if we change the amount and press Enter again - the pop-up shows anyway.

if (session.findById("wnd[1]").visible===true) {

  session.findById("wnd[1]/tbar[0]/btn[0]").press();

  session.findById("wnd[1]/tbar[0]/btn[0]").press();

  session.findById("wnd[1]/tbar[0]/btn[0]").press();

};

Thanks, Diana

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

in your onAfterRefresh, add this, no need to do it thrice:

if (session.idExists("wnd[1]")) {

  session.findById("wnd[1]/tbar[0]/btn[0]").press();

}

Former Member
0 Kudos

Thank you Sushant, but it doesn't work,pop-up shows anyway.

Can it be that for some reason onAfterRefresh and onBeforeRefresh screen events doesn't work?

Because previously we also had problem with recreating KB guide on scripting in our system.

0 Kudos

hi Diana,

That could be the case. Which kernel patch level you are on?

Regards,

Sushant

0 Kudos

also make sure that you assign the script at the right screen. in your case, when you see the pop up, then go into edit mode and attach the onAfterRefresh