Android - Troubleshooting¶
- Android TV
- Fire TV
- Android mobile
If you cannot find the solution to your problem in the troubleshooting section, please contact our customer support.
Restart SuitestDrive
Restart SuitestDrive after applying any fixes to allow changes to take effect.
ADB system installation¶
If you are having some unusual problems starting Android tests, this might be due to there being two ADB versions installed on the computer running the SuitestDrive that was used to add the Android device. A ADB version is installed by SuitestDrive and if you have a local ADB installation then they may collide.
SuitestDrive automatically moves the local ADB executable (if it exits) to the resources folder only after SuitestDrive is restarted. If you are experiencing problems restart SuitestDrive.
Adding Android device fails¶
If adding a device fails, please check/do the following:
-
Reboot the Android device.
-
Check that the device is connected to the Internet.
-
The device IP address you specified in Suitest is correct and reachable from the machine hosting SuitestDrive. To check this open
cmd
(or some other terminal) on the host machine and typeping [ANDROID DEVICE IP ADDRESS]
if the ping request does not fail with a conclusive error the IP address is correct. -
As a last measure restart SuitestDrive or the host computer.
Multiple build.gradle
files instrumentation¶
Your project will contain multiple build.gradle
files, do not put the Implementation
lines to the one in the root, instead choose the modules which you would like to instrument.
In our case (visible on the screenshot), the Implementation
code needs to be put into
app/build.gradle
. If you would put the Implementation
lines to the root build.gradle
you
would see the same error as on the screenshot in the bottom right.
If you cannot connect to your Android device from ADB¶
There are several scenarios of what can be blocking your device:
- Your device is connected to the SuitestDrive which is running. Please close the SuitestDrive and try again.
- You are connected to the device through Android studio. Please close the connection and try again.
- You are connected to the device directly from the command line.
- One of your colleagues is connected from ADB.
Gathering logcat
log from your Android device¶
The logcat
from Android devices is very useful when troubleshooting or debugging. To retrieve the logcat
do the following in your terminal or command line (on the computer which is running SuitestDrive controlling these devices):
adb shell
logcat -c
- Do the actions that are causing you issues within Suitest.
logcat -d
- Copy the full contents of the log.
- Optionally, create a simple text file with the contents.
If you have multiple Android devices connected¶
adb -s <IP of the device> shell
logcat -c
- Do the actions that are causing you issues within Suitest.
logcat -d
- Copy the full contents of the log.
- Optionally, create a simple text file with the contents.
Video properties are not working¶
Please make sure that your video player is based on the VideoView
class.
If you are using a different player, look at following page.
Manufacturer-specific issues¶
Application installation is forbidden on Xiaomi¶
Make sure that the device has Developer options unlocked.
Please follow the steps below to fix the problem:
-
Open Developer options (under Settings -> Additional settings)
-
Turn off "MIUI optimization" (if you have not yet done) and restart the device
-
Turn on "USB debugging"
-
Turn on "Install via USB"
-
Set up "USB configuration" value to "No data" (works also with "PTP")
-
Add again the device to Suitest
I cannot test a dialog element¶
Not being able to test a dialog can be caused by using a pure dialog solution. Unfortunately, Suitest does not support this due to technical limitations. What we do support is using the FragmentManager
API.
Here are 2 examples of a dialog element that Suitest can test:
// the first solution
public class TransactionDialogFragment extends DialogFragment {
@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
AlertDialog alertDialog = new MyAlertDialog(getActivity());
alertDialog.setOwnerActivity(getActivity());
return alertDialog;
}
}
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
fragmentTransaction.add(new TransactionDialogFragment(), "dialogFragment");
fragmentTransaction.commitAllowingStateLoss();
// the second solution
public class LoginNonSupportDialog extends DialogFragment {
public static LoginNonSupportDialog newInstance() {
return new LoginNonSupportDialog();
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_dialog_layout, container);
}
}
LoginNonSupportDialog newFragment = LoginNonSupportDialog.newInstance();
newFragment.show(getFragmentManager(), "login");
On the other hand, here is an example of not working solution (when the dialog is added to the tree view without FragmentManager
API):
public class LoginPureDialog extends DialogFragment {
public static LoginPureDialog newInstance(Activity activity) {
LoginPureDialog loginPureDialog = new LoginPureDialog();
loginPureDialog.setActivity(activity);
return loginPureDialog;
}
private Activity activity;
public void setActivity(Activity activity) {
this.activity = activity;
}
@Override
public Dialog getDialog() {
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity);
View root = activity.getLayoutInflater().inflate(R.layout.alert_dialog, null);
dialogBuilder.setView(root);
final AlertDialog alertDialog = dialogBuilder.create();
return alertDialog;
}
}
LoginPureDialog newFragment = LoginPureDialog.newInstance(LoginDialogActivity.this);
newFragment.getDialog().show();