Emanuel
New Member.
930 views

get the text in silk classic

How I can get texts in Silk classic?, in silk4j I using the method .getText() to get the tex for example :

 desktop.<MobileObject>find("//MobileDevice//MobileObject[@resource-id='android:id/message']").getText();

 

thanks for the help

  

0 Likes
5 Replies
Micro Focus Contributor
Micro Focus Contributor

RE: get the text in silk classic

GetText() is the method you require for Silk Test Classic. As there are a number of overloads with the method, I'd recommend reading the Help file to see which (if any) parameters you need.
0 Likes
Emanuel
New Member.

RE: get the text in silk classic

thanks, do you have any example how to used it, because the log send me a message of error :

Function GetText is not defind for window

this is how I wrote it: PREPRODUCCIÓNGNPSiniestrosJAVA.AtenciónRemota.GetText()
0 Likes
Highlighted
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

RE: get the text in silk classic

Hi Emanuel,

As Silk4J utilizes java then values are set using Set methods. In Silk Test Classic you can use methods and properties to retrieve data from an object, therefore in your instance you should use the text property to retrieve the text of a mobile object, like so:

[ ] Print(PREPRODUCCIÓNGNPSiniestrosJAVA.AtenciónRemota.Text)

Hope this helps.

John
0 Likes
Emanuel
New Member.

RE: get the text in silk classic

Thanks , I Tried this way but the real issue I have is that the stand alone application that I tried to recording only is identified by coordinates when i used silk classic , so i dont find a method that get the text of a especific coordinates, or another way to get this text.
0 Likes
Micro Focus Contributor
Micro Focus Contributor

RE: get the text in silk classic

If you get recognition of the application in Silk4J but you don't get recognition in Silk Test Classic then we are not hooking the application correctly for some reason. Please raise a support incident and we'll work with you to resolve the problem.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.