Showing posts with label using. Show all posts
Showing posts with label using. Show all posts

Friday, September 29, 2017

Using Robotium to test Android “Text Fields”

Using Robotium to test Android “Text Fields”


Robotium supports various functions to test Android single and multi line text fields.
The following are few APIs supported by Robotium to test the Text Fields,
  • searchEditText(String text)
  • clickOnEditText(int index)
  • clearEditText(int index)
  • typeText(int index, String text)
  • enterText(int index, String text)
Let us write a test case for the Sample project shown on the right side,

Test case for verifying the Text Fields :

Steps :
  1. Wait for the activity to launch
  2. Enter a text in the Text Field
  3. Verify the text entered in the Text Field
  4. Clear the Text Entered in the Text Field
  5. Enter a new Test again and Verify the text entered.
Test Code:
 1: public void testEditField() throws Exception {

 2: solo.waitForActivity("MainActivity");

 3: 

 4: solo.clickOnEditText(0);

 5: String strInput = "Sample code 1";

 6: solo.enterText(0, strInput);

 7: boolean actual = solo.searchEditText(strInput);

 8: assertEquals("text entered is not matching",true, actual);

 9:  

 10: solo.clearEditText(0);

 11: strInput = "Sample code 2";

 12: solo.typeText(0, strInput);

 13: actual = solo.searchEditText(strInput);

 14: assertEquals("text entered is not matching",true, actual);

 15: }

Explanation:
  1. solo.waitforActivity( ), is to wait for the activity to launch

  2. Enter Text in the Text Field :  to enter a text in the Text filed, both �solo.enterText()� and �solo.typeText()� can be used.

  3. in �enterText(int index, String text)�,  index is the index of the Text Field.

    • if multiple Text Fields exists, first one will be assigned an index of 0, second one will get an index 1 and so on..  index increases from Top to Bottom or Left to Right

    • Verify the Text Entered :  to verify the text contained in the Text Filed, �solo.searchEditText()� can be used. it returns True, if pattern matches otherwise return False

  4. Clear the Text in the Text Field : to clear the Text exist in the Text Field, �solo.clearEditText()� can be used.

  5. �assertEquals()�, can be used to assert True/False


download file now

Read more »

Thursday, September 28, 2017

Using Google as a Proxy

Using Google as a Proxy


google proxy server
We often use schools and colleges internet connections, but they usually block access to undesired web sites (the "black list"). In order to access those sites you can do is use google translate as  proxy to bypass this restrictions. So lets get into it.

Method 1

1. Visit whatismyipaddress and note down you real Ip Address
2. Now Go to Google Translate
3. From Under Detect Language, Chose your language in my case English
4. Now type http://whatismyipaddress.com/  in text area and click on Translate
5. Now check your Ip Address, Its different from the real one.

Method 2

1. Go to link given below:
http://www.google.com/translate?langpair=es|en&u=www.mybloggersworld.com
2. Change www.mybloggersworld.com to website you like to visit.
3. Done!

If you use this trick, you are not sure to protect your privacy, this kind of connection lets you see blacklisted or banned pages but does not hide your IP address.


download file now

Read more »

Wednesday, September 27, 2017

Easy Way to install Android Applications Using 91 Android PC Suite

Easy Way to install Android Applications Using 91 Android PC Suite




This application is useful when your Android handset has no File Manager and Play Store that installed in your mobile.

Download 91 Android PC Suite here and install to your computer.Right click the shortcut icon then Run as Administrator and your mobile must in USB Debugging mode.

Tested on Sony Ericsson android handset. When your handset detected by this application software click Apps tab and a window will appear.



Click the Install tab and locate the apk file that saved in your computer.


Open the apk file that you want and click Install