Responsive Ad Area

Share This Post

test

java.lang.NoClassDefFoundError while running scripts in eclipse for mobile app testing

I am getting exception as java.lang.NoClassDefFoundError while running scripts in eclipse.But the appium can able to launch app but code is not working fully

Here is my code


   @SuppressWarnings("rawtypes")
   public static void main(String[] args) throws Throwable
   {
    DesiredCapabilities  c = new DesiredCapabilities();
    c.setCapability(CapabilityType. BROWSER_NAME, ""); 
    c.setCapability("deviceName","52034c9a5fcd9400");  
    c.setCapability("platformName", "android"); 
     c.setCapability("platformVersion","5.1.1");
    c.setCapability("appPackage", "com.sec.android.app.popupcalculator");
    c.setCapability("appActivity",  
    "com.sec.android.app.popupcalculator.Calculator");

       URL  u =new  URL("http://0.0.0.0:4723/wd/hub"); 


     AppiumDriver<MobileElement> driver = new 
      AndroidDriver<MobileElement>(u,c); 

    // driver.get("https://www.google.com/");
     Thread.sleep(15000);


     driver.findElement(By.xpath("//*[@text='8'][@index='1']")).click(); 
     driver.findElement(By.xpath("//*[@text='9'][@index='2']")).click(); 
     driver.findElement(By.xpath("//*[@content-desc='plus'] 
     [@index='3']")).click(); 
     driver.findElement(By.xpath("//*[@text='7'][@index='0']")).click(); 
     driver.findElement(By.xpath("//*[@text='4'][@index='0']")).click(); 
     driver.findElement(By.xpath("//*[@content-desc='equals'] 
     [@index='2']")).click(); 
     Thread.sleep(5000); 


     }

Here is the error:


java.lang.NoClassDefFoundError while running scripts in eclipse for mobile app testing
java.lang.NoClassDefFoundError while running scripts in eclipse for mobile app testing
test
{$excerpt:n}

Share This Post

Leave a Reply

Your email address will not be Publishedd. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Skip to toolbar