im getting below error, local panel shows there is Input value(170200192577)but bot is not able to do typeinto, as throws with error.Can you please let me know resolution.
Type Into ‘INPUT Search PO Number’: Length cannot be less than zero.
Parameter name: length
You’re doing nested Ifs. Honestly that’s poor coding. Use Else If. Much cleaner. Or use a Switch since it looks like all you’re doing is checking the value of DocType.
If all you’re doing is typing in a different value depending upon DocType, create a local variable and use a Switch to populate it with the value to type in, and then you don’t even need to have multiple Type Into activities.
The Substring method takes 2 arguments - Start Index and Length. In your case Length is -1 because IndexOf returns -1 if the string you are looking for (" ERS") is not found in the source string (in_PurchaseOrder). This is why you get the error - Length cannot be -1.
You need to add some logic to handle situations where " ERS" is not present in in_PurchaseOrder
Best first clean in_PurchaseOrder from any unwanted characters/strings and assign the result to a new variable. Then use that cleaned variable in Type Into