Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6613469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:13:20+00:00 2026-05-25T20:13:20+00:00

I have been trying to implement database in robotium so that i can parametrize

  • 0

I have been trying to implement database in robotium so that i can parametrize and make it data oriented but i am completely lost please guide me.My robotium code is mentioned below please guide me on how can i open a database connection with sqlite.

package com.dialog.test;

import android.test.ActivityInstrumentationTestCase2;
import com.jayway.android.robotium.solo.Solo;

public class TestNew extends ActivityInstrumentationTestCase2 {
    private Solo solo;


    //private Activity Main;
    private static Class class1;
    static
    {
        try {
            class1=Class.forName("com.botskool.DialogBox.DialogBox");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
    public TestNew() {
        super("com.botskool.DialogBox", class1);
    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        this.solo = new Solo(getInstrumentation(), getActivity());
    }

    @Override
    protected void tearDown() throws Exception{
        try {
            this.solo.finalize();
            } catch (Throwable e) {
                e.printStackTrace();
            }
            getActivity().finish();
                super.tearDown();
            }

    public void testDisplay(){
        solo.clickOnButton(0);
        solo.clickOnButton("Ok");
        solo.clickOnButton(2);
    }
}

Even the smallest guidance would be of great help thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:13:20+00:00Added an answer on May 25, 2026 at 8:13 pm

    You can use File IO of java to integrate in robotium script. provide the File path as of the path in android device like /system/docs/test1.txt . You can provide the details in a file and push the file to the device using adb push commands. and when the script runs, your parameters will be accessed. I am giving you sample code of robotium test case :

      public void test(){
    
    
        String strLine = "",PHN1="", MSG="", siters="";
        File f = null;
        try {
    
            f = new File("/system/SendSMS.txt");
            FileInputStream fileIS = new FileInputStream(f);
            BufferedReader buf = new BufferedReader(new InputStreamReader(fileIS));
            String readString = new String();
            while ((readString = buf.readLine()) != null) {
                strLine = strLine + readString;
            }
    
        } catch (Exception e) {
    
            Log.e("ERROR", "" + e.getMessage());
            e.printStackTrace();
        }
        PHN1 = strLine.substring(strLine.indexOf("[PHN1]")+"[PHN1]".length(), strLine.indexOf("[$PHN1]"));
        MSG = strLine.substring(strLine.indexOf("[MSG]")+"[MSG]".length(), strLine.indexOf("[$MSG]"));
        siters = strLine.substring(strLine.indexOf("[ITERS]")+"[ITERS]".length(), strLine.indexOf("[$ITERS]"));
        int iters = Integer.valueOf(siters);
        Log.i("D2Tech","SMS Contact : "+PHN1);
        Log.i("D2Tech","SMS Message : "+MSG);
        Log.i("D2Tech","SMS Iterations : "+iters);
        PHN1="0183030689,0183030687";
        iters=50;
    
        for(int j = 1; j<= iters ; j++ ){
    
                solo.clickOnText("New message");
    
    
                solo.enterText(0, PHN1);
    
                solo.enterText(1, MSG + j);
                solo.goBack();
                solo.clickOnButton("Send");
                solo.goBack();
                Log.i("D2Tech","SMS Message number : "+j);
    
        }
        solo.waitForDialogToClose(1000);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to implement unit testing and currently have some code that does
I am new to design patterns, but I have been trying hard to implement
I have been working on trying to leverage data contained in an Access Database
I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL,
I have been trying to understand the way ActionScript's events are implemented, but I'm
OK. So I have been trying to implement a timer. Now a very weird
We have a set of views (quite a few) that we're trying to implement
I have been trying to find a really fast way to parse yyyy-mm-dd [hh:mm:ss]
I have been trying to determine a best case solution for registering a COM
I have been trying to work my way through Project Euler, and have noticed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.