honeynet/droidbot

Automate third-party sign-in functionality found in android apps

Closed this issue · 2 comments

Hello Friends,

Quick question:

I'm trying to use Droidbot to automate login functionality with Facebook supported by the app. I've seen and followed the video example of bypassing a login screen within an app.

I just want to automate the following: click sign-in with Facebook, chrome opens, write username, password, click login, click confirm (to authorize app), and then go back to the app and interact with it.

So far I'm only able to automate writing username, and password.

Thanks :)

Hi @Sultan-Aloufi , if I understand correctly, you want to write a script to perform "click" actions on several buttons, right?
Basically, you need to figure out how to select the target view at runtime, like how the login_button was selected in the sample script https://github.com/honeynet/droidbot/blob/master/script_samples/pass_login_script.json

There are also other ways to select the button that you want to click. The syntax is at https://github.com/honeynet/droidbot/blob/master/droidbot/input_script.py#L243

class ViewSelector(object):
    """
    selector used to select a view
    """
    selector_grammar = {
        'text': REGEX_VAL,
        'resource_id': REGEX_VAL,
        'class': REGEX_VAL,
        'out_coordinates': [[INTEGER_VAL, INTEGER_VAL]],
        'in_coordinates': [[INTEGER_VAL, INTEGER_VAL]]
    }

So ideally you can use the resource_id or text to match the target view. If it fails, you can try the 'in_coordinates' field, where you put one or more coordinates that are included in the target view.

Thanks @yuanchun-li. I've managed to write the json script I needed. Some views don't have a resource_id so I will use text to match instead.

Great tool and thanks for the reply.