TestProject Forum

Adb_shell has not been enabled

Firstly I’m new to the TestProject framework.

I have started automating the Android mobile APP and I’m trying to run it in the BrowserStack emulators. In the App, I need to login by entering the Login details. I have created the Test to login into the APP and it is running successfully without any errors with my physical android device but when I try to run that test in BrowserStack emulators there is an error while setting text in username and password fields.

Can someone help me with this on how to enable adb_shell from TestProject.


Hello @srianoop.d,

Currently actions that use ADB are not supported on BrowserStack,
May I ask what is the action that your using, that utilizes ADB?

Hello @artem.kuznetsov

I wanted to enter my username and password in the APP. So I have added the steps to enter Username and Password using ““Type text (if visible) - Type {{text}} in {{element}} if visible”” Element action.

When I run this on my Physical android device it is working fine and it is adding the username and password. But when I try running the test over Browserstack emulators, that’s when I’m facing that ADB error. In Browserstack emulators it is able to click on the input field(Username) but it is not able to enter the text which I have provided.

I have also tried with this Action too to enter set the username and password.
Type text (using ADB), But it didn’t work.

Can you help me with this.
Thank you.

Screenshot 2021-03-09 091415

Hello @srianoop.d,

Can you please send us your BrowserStack logs to our support email:

Hello @artem.kuznetsov
I have mailed the logs.

Hello @srianoop.d,

From the logs it seems that it couldn’t find an element(using xpath //android.widget.EditText[@text = ‘Username’]), It seems that this element is that text box that you are trying to type in.

Does the device you are testing on in BrowserStack, has a different viewport than the device you recorded on?
It might be that the textbox is not present on the screen at that moment and thus the test fails.

BrowserStack outputs an ADB error, because the default behavior of the agent is to try “Type Text with ADB”, if the regular “Type Text” didn’t work.

I would suggest you make a recovery test that will execute when the “Type text” action fails,
that recovery test will have one step that will swipe to the element, using one of this actions depending on the location of the element:

To add a recovery test, change the “On Failure Behavior” of the step:

Yeah @artem.kuznetsov I will try this one.

I will get back if I had some doubts.