Gingerbread vs Froyo

27 views
Skip to first unread message

supriya

unread,
Apr 3, 2012, 2:48:40 AM4/3/12
to seleniu...@googlegroups.com
Hii all,
i have run the following code successfully on android 2.3.6 i.e. GingerBread but running on Froyo i.i. android 2.2.1 is giving noSuchMethod found exception.
i have done setup for bath the devices i.e. API-8 and API-10.
Plz guide me where i m wrong... what is the difference here in between coding for these two devices?


package simple.app.test;

import android.test.ActivityInstrumentationTestCase2;
import org.openqa.selenium.*;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.android.AndroidWebDriver;
import org.openqa.selenium.interactions.Actions;
//import org.openqa.selenium.android.library.AndroidWebElement;
import java.io.*;
import java.util.*;
import java.lang.reflect.Member;


import simple.app.SimpleAppActivity;

public class SimpleGoogleTest extends ActivityInstrumentationTestCase2<SimpleAppActivity> {
    private WebDriver driver;
    
    public SimpleGoogleTest() {
        super("simple.app", SimpleAppActivity.class);
    }
    
    @Override
    protected void setUp() throws Exception {
      driver = new AndroidWebDriver(getActivity());
    }
    
    @Override
    protected void tearDown() {
       driver.quit();
    }
    
    public void testGoogleWorks() {
        driver.get("http://www.barclays.mobi");
      driver.findElement(By.linkText("Find your nearest branch/ATM")).click();
 driver.findElement(By.cssSelector("input[value='ATM']")).click();
driver.findElement(By.id("submit")).click();
try
{Thread.sleep(7000);}
catch(Exception e)
{}
driver.findElement(By.cssSelector("div.row0 > p.seeMore > a")).click();
try
{Thread.sleep(10000);}
catch(Exception e)
{}
assertEquals("Facilities", driver.findElement(By.cssSelector("div.infoBoxFacilities > h3")).getText());
   }
}


Thanks in Advance
Supriya

supriya singla

unread,
Apr 3, 2012, 3:22:12 AM4/3/12
to seleniu...@googlegroups.com
my console output:


[2012-04-03 11:53:48 - TestAnAndroidWebApp] ------------------------------
[2012-04-03 11:53:48 - TestAnAndroidWebApp] Android Launch!
[2012-04-03 11:53:48 - TestAnAndroidWebApp] adb is running normally.
[2012-04-03 11:53:48 - TestAnAndroidWebApp] Performing android.test.InstrumentationTestRunner JUnit launch
[2012-04-03 11:53:48 - TestAnAndroidWebApp] Automatic Target Mode: using device 'S5570a15bd272'
[2012-04-03 11:53:48 - TestAnAndroidWebApp] Uploading TestAnAndroidWebApp.apk onto device 'S5570a15bd272'
[2012-04-03 11:53:51 - TestAnAndroidWebApp] Installing TestAnAndroidWebApp.apk...
[2012-04-03 11:53:57 - TestAnAndroidWebApp] Success!
[2012-04-03 11:53:58 - TestAnAndroidWebApp] Project dependency found, installing: SimpleApp
[2012-04-03 11:53:58 - SimpleApp] Uploading SimpleApp.apk onto device 'S5570a15bd272'
[2012-04-03 11:53:58 - SimpleApp] Installing SimpleApp.apk...
[2012-04-03 11:54:11 - SimpleApp] Success!
[2012-04-03 11:54:12 - TestAnAndroidWebApp] Launching instrumentation android.test.InstrumentationTestRunner on device S5570a15bd272
[2012-04-03 11:54:14 - TestAnAndroidWebApp] Collecting test information
[2012-04-03 11:54:17 - TestAnAndroidWebApp] Sending test information to Eclipse
[2012-04-03 11:54:17 - TestAnAndroidWebApp] Running tests...
[2012-04-03 11:54:52 - TestAnAndroidWebApp] Test run failed: Instrumentation run failed due to 'java.lang.NoSuchMethodError'
[2012-04-03 11:54:52 - TestAnAndroidWebApp] Test run finished

Supriya

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/0IDoFPlmd9EJ.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Reply all
Reply to author
Forward
0 new messages