Showing results for 
Search instead for 
Did you mean: 

How do we fetch the text from a input box in SAP GUI desktop client using c# (Automation)

0 Kudos

I'm trying to automate SAP GUI Desktop client in C# and using these article as an reference for the same

I'm able to launch the GUI and perform the required operations but unable to fetch text from a input box and then some text from the execution logs. I have tried this code to get the text but this doesn't seems to be working.

GetProperty(this.ID, "text", new object[1] { requiredLocator })

The error that I get is


which will occur if the locator is not loaded properly, which is not the case here.

Is there any way we can fetch the text? Also, is this the recommended way to do this?

Former Member
0 Kudos

Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time, I recommend that you familiarize yourself with:, as it provides tips for preparing questions that draw responses from our members.

For example, you can:

- outline what steps you took to find answers (and why they weren't helpful)

- share screenshots of what you've seen/done

- make sure you've applied the appropriate tags

- use a more descriptive subject line

The more details you provide, the more likely it is that members will be able to respond. Feel free to also take our Q&A tutorial at:

Should you wish, you can revise your question by selecting Actions, then Edit.

By adding a picture to your profile you encourage readers to respond:

Questions on how to draw responses from members? Check out this discussion on how to improve questions.

View Entire Topic
0 Kudos

I got the answer by trial and error.I was using the wrong method. Writing it here as an answer as it could be helpful to someone.

Instead of this method

  GetProperty(this.ID, "text", new object[1] { requiredLocator })

We should use this method

  InvokeMethod(this.ID, "Text", new object[0])

where the *requiredLocator* and *ID*

can be set as

  this.ID = InvokeMethod(this.session, "findById", new object[1] { requiredLocator})