How to extract text using RPA.JavaAccessBridge library

Hello Everyone,

Is anyone have automated JAVA application using Robocorp? I am searing for a keyword from which we can extract text from JAVA application using RPA.JavaAccessBridge library.

Thank you!

Hi @mohini.shelke .

Library keyword documentation is a good starting place :wink:

Hi @mika

Yes, I have gone through the keyword documentation. I have tried below keywords but this is not extracting the value what I wanted.

  1. Get Element Text
  2. Get Elements

If you know the exact keyword or the format, Please help me!

Have you checked with Google Access Bridge Explorer that you can see the element you are interested in ? And you have seen there some property containing the value you are interested in ?

If yes, then you should be able to use for example that Get Elements keyword and get all info about the elements (especially when you set parameter java_elements=True).

Yes I am using Access bridge explorer.
I am using below command:
${elements}= Get Elements role:label and name:Request submitted. java_elements=True

Result : [JavaElement(name=‘Request submitted. \n(Request ID = 514419273)\n\nSubmit another request?’, role=‘label’, states=[‘enabled’, ‘visible’, ‘showing’], checked=False, selected=False, visible=True]

How I will retrieve only name from this output result?

There is actually Python and Robotframework syntax examples in the Get Elements keyword.

That keyword returns array of elements. If you are expecting just one result, you could do this.

${elements}= Get Elements role:label and name:Request submitted.  java_elements=True
${name}=   Set Variable  ${NONE}
IF  len($elements)==1
    ${name}=    Evaluate    $elements[0].name
ELSE
    Log To Console   Did not get expected list of elements 
END

Thank you @mika :slightly_smiling_face:

It is working and I am able to extract text as expected!