How to retrieve the value from textbox

245 views
Skip to first unread message

Kiran

unread,
Mar 11, 2013, 1:35:30 AM3/11/13
to Robotium Developers
Hi,

Can some one help me on how to retrieve value from a text box using
Remote Robotium. I used the command solo.getEditText(index) to get
value from text box and I observed that getEdiitText command returns
the UID reference value of Text box but not the EditText object. Is
there any way to use UID reference and get the value of the text box.
Appreciate if some one could post a sample code to retrieve the value
from text box.

Thanks in advance,
Kiran.

Carl Nagle

unread,
Mar 11, 2013, 3:11:01 PM3/11/13
to robotium-...@googlegroups.com
Kiran,

Robotium RemoteControl when used standalone is really intended to only make the pure Robotium Solo API (v3.6) available in a local TestRunner available remotely to an external controller. Since the Solo API (v3.6) does not have methods to provide property values; the RemoteControl API doesn't either. And since the AUT under test is actually on a completely different physical machine/device there is no way you can actually get the live AUT application component to play with remotely.

To support something like that, we would need to provide "agents" or "proxies" to interrogate such objects with a copy of the API; or expose some basic methods beyond the Solo API to provide more features like "getPropertyNames" and "getPropertyValue", etc..

This is not available via Robotium RemoteControl today because we wanted to keep the initial support very close to what the Solo API provides.

With that being said, there is the ability to do a lot more via "Remote Control" by using the SAFS extensions to Robotium RemoteControl.

To give you an idea of what SAFS can do via "Remote Control" I've provided a few links below:

Android Engine Commands:
http://safsdev.sourceforge.net/sqabasic2000/AndroidEngineComponentCommandsIndex.htm

Android ComponentFunction Commands:
http://safsdev.sourceforge.net/sqabasic2000/DRDComponentFunctionsList.htm

To see the SAFS Android Quick Reference--including more Android commands:
http://safsdev.sourceforge.net/sqabasic2000/DRDQuickReference.htm (Look for keywords tagged as "DRD" supported.)


What this would entail is building the SAFSTestRunner instead of a RobotiumTestRunner and controlling it in much the same way as the Solo Remote Control API talks with the RobotiumTestRunner.

In my mind there are 3 ways to do this:

1) Use SAFS "as-designed" with test tables and the standard SAFSDRIVER.
This eliminates the need for Java programming for your tests.
The test is a keyword-drive/data-driven test interpreted and controlled by SAFSDRIVER.
This is a full-blown SAFS install with STAF and SAFS services running on the controller and the
SAFSTestRunner running on the device.

2) Use JSAFS (your own Java programs) to control the SAFS Android Engine running "as-designed".
This allows your Java program to replace the SAFSDRIVER and control the running SAFS Android Engine as you see fit.
The JSAFS API still sends commands as SAFS test records to the device and the responses are handled via standard SAFS
mechanisms that hide the inner workings of "Remote Control" for the programmer\tester.
This is a full-blown SAFS install with STAF and SAFS services running on the controller and the
SAFSTestRunner running on the device.

3) Use the SAFSTestRunner, but control it with your own Java program that provides the proper Properties and API calls
like the Solo RemoteControl class does for Robotium RemoteControl. This is something new that we haven't tried
because...well...we use SAFS "as-designed". But I'm thinking this might be a good thing to make available for pure
"Remote Control" users. It would provide all the device-side capabilities available to SAFS, but would not require
STAF nor the SAFS services. (Of course, that also means developers\testers won't have the benefits provided by STAF
and the SAFS services, either.)

Below are some links that would show what a non-SAFS controller would have to do to take advantage of the SAFSTestRunner without actually using SAFS.

http://safsdev.sourceforge.net/doc/org/safs/android/DEngineCommandProcessor.html

http://safsdev.sourceforge.net/doc/org/safs/android/engine/processor/TestStepProcessor.html

How this is done would have to be deduced by reviewing the remote control Solo class sourcecode:

http://safsdev.sourceforge.net/doc/com/jayway/android/robotium/remotecontrol/solo/Solo.html

This sounds like something we should try to provide to Robotium RemoteControl users if they want it. It will mean a larger install\test footprint and the larger SAFSTestRunner APK.


Carl Nagle
SAS Research and Development
Planning, Operations and Strategy
General Applications and Tools
Carl....@sas.com
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages