Pergunta

I am using MonkeyTalk to automate some user test cases for my Android app. Everything is working fine except for when I try and detect a button containing this string:

"Connect\n(Code Required)"

I get this error:

FAILURE: Unable to find Button(Connect\n(Code required))

If I change the button to "Connect" and perform a tap on that value MonkeyTalk has no trouble, but something about the line break must be throwing it off.

After some searching I found this thread that confirmed my suspicious about the line break. There was one suggested fix here, to set the default encoding to UTF-8 (Select the Project > File > Properties > Resources)

However this did not work for me.

I have also tried to find the button using a wildcard like so:

"*(Code Required)"

But this does not seem to be supported either.

Maybe there is an alternative line break character I could use?

Thanks in advance for the help!

Foi útil?

Solução

Maybe there's a carriage return in there? I know in most text editors a new line actually consists of (carriage return)+(newline).

Also take a look at this: TextView carriage return not working

Also, depending on how flexible your requirements are, you could use the #N MonkeyId replacement to get the Nth button.

Outras dicas

IN javascript you can use below command

app.button("buttonname").tap(x, y);

Use android:contentDesxription="your_component_id" in your view xml file definition or view.setContentDescription("your_component_id"); directly on view in code to make it easy to access in MonkeyTalk.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top