Hi,
I have created two applications.
First one is a sample android application(AndroidJUnit) and the second one is Robotium test application(AndroidJUnitTest) to test first application.
My requirement is that if any crash is happened in first application during automation test, that log should be captured in second application i.e. inside Robotium test application(AndroidJUnitTest).
If anyone have any solution please help me. Any help is appreciated. It is very urgent.
My code is as follows
First Application[AndroidJUnit]
This code is trying to lunch Second Activity. Here intentionally I have kept the target Activity as null to get NullPointerException.
mSendEmail.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(MainActivity.this,null);
startActivity(intent);
}
});
Second Application[AndroidJUnitTest]
Below is the code to test the above code. That is when the click event will happen on “Send” button then testLunchActivity() should able to capture the log of first application i.e. NullPointerException.
public void testLunchActivity(){
try{
solo.clickOnButton(R.id.mSendMail);
assertTrue(true);
}catch(Exception e){
logReport("testLunchActivity",e);
}
For any clarifications kindly let me know.
Regards,
Biswa
I have created two applications.
First one is a sample android application(AndroidJUnit) and the second one is Robotium test application(AndroidJUnitTest) to test first application.
My requirement is that if any crash is happened in first application during automation test, that log should be captured in second application i.e. inside Robotium test application(AndroidJUnitTest).
If anyone have any solution please help me. Any help is appreciated. It is very urgent.
My code is as follows
First Application[AndroidJUnit]
This code is trying to lunch Second Activity. Here intentionally I have kept the target Activity as null to get NullPointerException.
mSendEmail.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(MainActivity.this,null);
startActivity(intent);
}
});
Second Application[AndroidJUnitTest]
Below is the code to test the above code. That is when the click event will happen on “Send” button then testLunchActivity() should able to capture the log of first application i.e. NullPointerException.
public void testLunchActivity(){
try{
solo.clickOnButton(R.id.mSendMail);
assertTrue(true);
}catch(Exception e){
logReport("testLunchActivity",e);
}
For any clarifications kindly let me know.
Regards,
Biswa