How to find the current cursor position using native Terminal activities?
Root Cause:
Currently, there is no activity predefined in UiPath to retrieve the cursor position. Thus this can be achieved with code.
Sometimes network lag or slowness in response will cause unexpected results. Hence adding a timeout in the connection method will help resolve the issue.
Resolution: Currently, there is no activity predefined in UiPath to retrieve the cursor position. Thus this can be achieved with code.
Follow the below steps:
Upgrade the UiPath.Terminal.Activities to 2.7.3 using this source https://pkgs.dev.azure.com/uipath/Public.Feeds/_packaging/UiPath-Official/nuget/v3/index.json
Save the Terminal connection (OutputConnection property for the terminal session) into a variable ("conn")
If you can move the cursor on desired screen area on AS400, then you can use the âGet Field at positionâ activity and it retrieves the Row and Column.
Get Field at Position does not get the row and column. The row and column are inputs telling it where to look for the field, and it gets the value in the field.
I have the same basic problem here. We have a screen that is built dynamically on the mainframe and we want to tab to each field down a column and clear the data before putting in new data based on input to the Performer.
We have been using the terminal session GetScreen to get cursor location as we know, when the column number changes, we have gone through all the fields that we wanted to clear.
This has been working for us until an upgrade of the Terminal Activities package to the latest Windows version and now we only get values of 1 for the row and the column.
Hey MalBee. I was wondering if you had a resolve on this situation? We are experiencing the same issue and getting FieldNotFound error so wanting to know if there are any alternative options or an outcome
Thanks for that - will have a look at which version we are running. Are you facing the FieldNotFound terminal error when the cursor canât be found also?
We donât normally use fields information, but I did notice that it wasnât returning any for me either when I was testing the rows and columns function. So in short, yes, there seems to be something amiss.
To get this logic to work you need to pass in a parameter within the CommandOptions() like so conn.GetScreen(new UiPath.Terminal.Data.CommandOptions(1000)).Cursor.Row