on 08-13-2013 7:47 PM
Hi, i recently posted discussion "T-code KSII script post despite errors". I have a follow-on question. Sometimes, when i try to post data, there are errors, so I have this code: 'This posts the data despite the errors If session.findById)"wnd[1]/usr/txtSPOP-TEXTLINE1").text = "Do you want to post data despite errors" Then session.findById("wnd[1]/usr/btnSPOP-OPTION1").press End If 'This selects the enter button when a pop-up box comes up to tell you that the data has been posted If session.findbyId("wnd[1] /usr/txtMESSTXT2").txt = "Data has been posted" Then session.findById("wnd[1]/tbar[0]/btn[0]").press But, when i try to post the data that doesn' t have "errors", the first pop-up box that says "Do you want to post data despite errors" does not pop-up. Which means that only the second pop-up box comes up ("Data has been posted"). How can i edit the code to take care of both situations? I tried this: If session.findById("wnd[1]/usr/txtSPOP-TEXTLINE1").text = "Do you want to post data despite errors" Then session.findById("wnd[1]/usr/btnSPOP-OPTION1").press Else If session.findById("wnd[1]/usr/txtMESSTXT2").text = "Data has been posted" Then session.findById("wnd[1]/tbar[0]/btn[0]").press End If But it didn't work. Can anybody help?! Thanks, Chrissy
Hi Chrissy,
It's all right, as you have done it. Now you need only add the following commands:
. . .
on error resume next
End If
If session.findbyId("wnd[1]/usr/txtMESSTXT2").text = "Data has been posted" Then
session.findById("wnd[1]/tbar[0]/btn[0]").press
End if
on error goto 0
. . .
Regards,
ScriptMan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.