Teste de Software, QA, DevOps

Automatização de game mobile utilizando Sikuli

magazine
news
sports
Street fashion
travel
Big data
business
business
business
Fashion show
fitness
health
lifestyle
Small tools
The recipe
The recipe
A bad girl
appetite
attitude
movies
rendezvous
sex
toys
catering
health
Lose weight
outdoors
Reduce weight
science
science
stretch
stretch
stretch
training
business
cookbook
fashion
fitness
health
magazine
news
news
sports
sports
sports
The recipe
Fitness equipment
Classic cars
Classic cars </a
Fashion magazine
Fashion show
Female models
Small tools </a
The recipe
Motor car
Science and technology
Lose weight
Lose weight
A bad girl
Street fashion
The recipe
Fitness equipment
Nutritious food
The recipe </a
hygiene </a
industry
invest
markets
medical
Motor car
Real estate
technique
animation
car
games
Motor car
movies
music
news
Science and technology
tutorial
business
cookbook
fashion
fitness
health
magazine
news
sports
Street fashion
travel
Big data
business
Fashion show
fitness
health
lifestyle
Small tools
The recipe
A bad girl
appetite
attitude
movies
sex
toys
catering
Lose weight
Reduce weight
Street fashion
travel
The recipe
tourism
Fitness equipment
Nutritious food
Classic cars
Classic cars
evaluation
technique
transact
business
Fashion magazine
Fashion show
Female models
fitness
health
lifestyle
Small tools
The recipe
travel
Motor car
Science and technology
Lose weight
Reduce weight
A bad girl
business
fashion
fitness
health
lifestyle
news
Small tools
Street fashion
The recipe
travel
Motor car
Real estate
Fitness equipment
Fitness equipment
The recipe
Motor car
Real estate
Motor car
Science and technology
Street fashion
Big data
Fashion show
Small tools
The recipe
A bad girl
appetite
attitude
movies
rendezvous
sex
toys
Lose weight
Reduce weight
Street fashion
The recipe
Fitness equipment
Nutritious food
Classic cars
Classic cars
business
Fashion magazine
Fashion show
Female models
Small tools
The recipe
Motor car
Science and technology
Lose weight
Reduce weight
A bad girl
Small tools
Street fashion
The recipe
Motor car
Real estate
Fitness equipment
Nutritious food
The recipe
Motor car
Real estate
Motor car
news
Science and technology
tutorial
business
cookbook
fashion
fitness
health
magazine
news
sports
Street fashion
travel
Fitness equipment
fitness
nutrition
Nutritious food
routine
training
video
Yoga
art
fashion
health
music
photography
sports
The recipe
tourism
travel
hygiene
industry
invest
markets
medical
Motor car
Real estate
technique
animation
car
games
Motor car
movies
music
news
Science and technology
tutorial
business
cookbook
fashion
fitness
health
magazine
news
sports
Street fashion
travel
Big data
business
Fashion show
fitness
health
lifestyle
Small tools
The recipe
A bad girl
appetite
attitude
movies
rendezvous
sex
toys
catering
news
Lose weight
outdoors
Reduce weight
science
stretch
training
business
cookbook
fashion
fitness
health
magazine
news
sports
Street fashion
travel
art
fashion
health
music
photography
sports
The recipe
tourism
travel
Fitness equipment
fitness
nutrition
Nutritious food
routine
training
video
Yoga
Classic cars
Classic cars
Fashion show
Female models
Small tools
markets
medical
Motor car
Real estate
Fitness equipment
Nutritious food
routine
Yoga
art
fashion
health
music
sports
The recipe
tourism
travel
hygiene
industry
markets
tutorial
medical
technique
animation
car
games
Motor car
movies
music
news
Science and technology
cookbook
fashion
magazine
news
sports
Street fashion
Big data
business
Fashion show
fitness
lifestyle
A bad girl
attitude
movies
rendezvous
sex
health
Lose weight
Reduce weight
science
stretch
training
business
cookbook
fashion
fitness
health
magazine
sports
Street fashion
music
sports
The recipe
tourism
Nutritious food
Classic cars
Classic cars
Fashion magazine
Fashion show
Female models
Small tools
The recipe
Motor car
Science and technology
Lose weight
Reduce weight
A bad girl
Small tools
Street fashion
The recipe
Motor car
Real estate
<a href=" https://poplarsparkburnhammarket.co.uk/wp-admin/includes/Motor%20car/
<a href=" https://poplarsparkburnhammarket.co.uk/wp-admin/includes/Real%20estate/
Fitness equipment
Nutritious food
The recipe
Motor car
Real estate
Motor car
Science and technology
Street fashion
Big data
Fashion show
Small tools
The recipe
A bad girl
appetite
Lose weight
Reduce weight
Street fashion
The recipe
Fitness equipment
Nutritious food
Classic cars
Classic cars
Fashion magazine
Fashion show
Female models
Small tools
The recipe
a href=” http://www.nodig.ir/wp-includes/Requests/Motor%20car/ “> Motor car
a href=” http://www.nodig.ir/wp-includes/Requests/Science%20and%20technology/ “> Science and technology
Lose weight
Reduce weight
A bad girl
appetite
Small tools
Street fashion
The recipe
Motor car
Real estate
Fitness equipment
Nutritious food
The recipe
Fitness equipment
Nutritious food
The recipe
Motor car
Real estate
Motor car
Science and technology
Street fashion
Big data
Fashion show
Small tools
The recipe
A bad girl
Reduce weight
magazine
news
sports
Street fashion
travel
Big data
business
business
business
Fashion show
fitness
health
lifestyle
Small tools
The recipe
The recipe
A bad girl
appetite
attitude
movies
rendezvous
sex
toys
catering
health
Lose weight
outdoors
Reduce weight
science
science
stretch
stretch
stretch
training
business
cookbook
fashion
fitness
health
magazine
news
news
sports
sports
sports
The recipe
Fitness equipment
Classic cars
Classic cars </a
Fashion magazine
Fashion show
Female models
Small tools </a
The recipe
Motor car
Science and technology
Lose weight
Lose weight
A bad girl
Street fashion
The recipe
Fitness equipment
Nutritious food
The recipe </a
hygiene </a
industry
invest
markets
medical
Motor car
Real estate
technique
animation
car
games
Motor car
movies
music
news
Science and technology
tutorial
business
cookbook
fashion
fitness
health
magazine
news
sports
Street fashion
travel
Big data
business
Fashion show
fitness
health
lifestyle
Small tools
The recipe
A bad girl
appetite
attitude
movies
sex
toys
catering
Lose weight
Reduce weight
Street fashion
travel
The recipe
tourism
Fitness equipment
Nutritious food
Classic cars
Classic cars
evaluation
technique
transact
business
Fashion magazine
Fashion show
Female models
fitness
health
lifestyle
Small tools
The recipe
travel
Motor car
Science and technology
Lose weight
Reduce weight
A bad girl
business
fashion
fitness
health
lifestyle
news
Small tools
Street fashion
The recipe
travel
Motor car
Real estate
Fitness equipment
Fitness equipment
The recipe
Motor car
Real estate
Motor car
Science and technology
Street fashion
Big data
Fashion show
Small tools
The recipe
A bad girl
appetite
attitude
movies
rendezvous
sex
toys
Lose weight
Reduce weight
Street fashion
The recipe
Fitness equipment
Nutritious food
Classic cars
Classic cars
business
Fashion magazine
Fashion show
Female models
Small tools
The recipe
Motor car
Science and technology
Lose weight
Reduce weight
A bad girl
Small tools
Street fashion
The recipe
Motor car
Real estate
Fitness equipment
Nutritious food
The recipe
Motor car
Real estate
Motor car
news
Science and technology
tutorial
business
cookbook
fashion
fitness
health
magazine
news
sports
Street fashion
travel
Fitness equipment
fitness
nutrition
Nutritious food
routine
training
video
Yoga
art
fashion
health
music
photography
sports
The recipe
tourism
travel
hygiene
industry
invest
markets
medical
Motor car
Real estate
technique
animation
car
games
Motor car
movies
music
news
Science and technology
tutorial
business
cookbook
fashion
fitness
health
magazine
news
sports
Street fashion
travel
Big data
business
Fashion show
fitness
health
lifestyle
Small tools
The recipe
A bad girl
appetite
attitude
movies
rendezvous
sex
toys
catering
news
Lose weight
outdoors
Reduce weight
science
stretch
training
business
cookbook
fashion
fitness
health
magazine
news
sports
Street fashion
travel
art
fashion
health
music
photography
sports
The recipe
tourism
travel
Fitness equipment
fitness
nutrition
Nutritious food
routine
training
video
Yoga
Classic cars
Classic cars
Fashion show
Female models
Small tools
markets
medical
Motor car
Real estate
Fitness equipment
Nutritious food
routine
Yoga
art
fashion
health
music
sports
The recipe
tourism
travel
hygiene
industry
markets
tutorial
medical
technique
animation
car
games
Motor car
movies
music
news
Science and technology
cookbook
fashion
magazine
news
sports
Street fashion
Big data
business
Fashion show
fitness
lifestyle
A bad girl
attitude
movies
rendezvous
sex
health
Lose weight
Reduce weight
science
stretch
training
business
cookbook
fashion
fitness
health
magazine
sports
Street fashion
music
sports
The recipe
tourism
Nutritious food
Classic cars
Classic cars
Fashion magazine
Fashion show
Female models
Small tools
The recipe
Motor car
Science and technology
Lose weight
Reduce weight
A bad girl
Small tools
Street fashion
The recipe
Motor car
Real estate
<a href=" https://poplarsparkburnhammarket.co.uk/wp-admin/includes/Motor%20car/
<a href=" https://poplarsparkburnhammarket.co.uk/wp-admin/includes/Real%20estate/
Fitness equipment
Nutritious food
The recipe
Motor car
Real estate
Motor car
Science and technology
Street fashion
Big data
Fashion show
Small tools
The recipe
A bad girl
appetite
Lose weight
Reduce weight
Street fashion
The recipe
Fitness equipment
Nutritious food
Classic cars
Classic cars
Fashion magazine
Fashion show
Female models
Small tools
The recipe
a href=” http://www.nodig.ir/wp-includes/Requests/Motor%20car/ “> Motor car
a href=” http://www.nodig.ir/wp-includes/Requests/Science%20and%20technology/ “> Science and technology
Lose weight
Reduce weight
A bad girl
appetite
Small tools
Street fashion
The recipe
Motor car
Real estate
Fitness equipment
Nutritious food
The recipe
Fitness equipment
Nutritious food
The recipe
Motor car
Real estate
Motor car
Science and technology
Street fashion
Big data
Fashion show
Small tools
The recipe
A bad girl
Reduce weight

administer
arthritis
company
design
designers
diet
drinks
entrepreneur
food
hackers
journey
limit
markets
menu
occupation
profits
publishers
restaurant
resume
retailers
sexy
shoot
sports
style
team
work
administer
arthritis
company
design
designers
diet
drinks
entrepreneur
food
hackers
journey
limit
markets
menu
occupation
profits
publishers
restaurant
resume
retailers
sexy
shoot
sports
style
team
work
activity
banks
business
earnings
economy
enterprise
Interest rate
investment
Make a profit
markets
Motor car
oil
plan
profits
shares
transact
valor
advertising
alliances
animation
art
band
foundation
fun
games
hero
hot
manufacturing
movies
music
Rock and roll
series
song
time
vocalist
arthritis
coitus
Diabetes mellitus
dirty
estrogen
gender
girl
impotence
libido
menstrual cycle
prostitute
Reproductive
Sex party
underwear
anxiety
art
battle
beauty
calories
climbing
combustion
entertainment
exercise
food
future
gain
guide
life
locomotion
suggest
advertising
alliances
animation
art
band
foundation
games
hero
hot
manufacturing
movies
music
Rock and roll
series
song
time
vocalist
appetite
apply
artifice
benefit
building
business
city
company
cosmetics
costume
data
design
designers
details
develop
Duties and responsibilities
entrepreneur
family
fashion
finery
food
hackers
hairstyle
health
jewelry
life
limit
locomotion
marketing
markets
method
Microsoft
muscle
nutrition
perfume
profits
shoot
sleep
style
tourism
anxiety
art
battle
beauty
calories
climbing
combustion
entertainment
exercise
food
future
gain
guide
life
locomotion
suggest
anxiety
art
battle
beauty
calories
climbing
combustion
entertainment
exercise
food
future
gain
guide
life
suggest
appetite
apply
artifice
benefit
building
business
city
company
cosmetics
costume
data
design
designers
details
develop
Duties and responsibilities
entrepreneur
family
fashion
finery
food
hackers
hairstyle
health
jewelry
life
limit
locomotion
marketing
markets
method
Microsoft
muscle
nutrition
perfume
profits
shoot
sleep
style
tourism
activity
banks
business
earnings
economy
enterprise
Interest rate
investment
Make a profit
markets
Motor car
oil
plan
profits
shares
transact
valor
Anewcar
audi
champion
driver
Electricmachine
Electricpower
Mercedes
mix
Modelcar
Modelnumber
nursing
order
performance
repair
security
sportscar
team
technique
Theautoshow
Thedetector
Thefilter
Thetrack
tire
traffic
appetite
apply
artifice
benefit
building
business
city
company
cosmetics
costume
data
design
designers
details
develop
Duties and responsibilities
entrepreneur
family
fashion
finery
food
hackers
hairstyle
health
jewelry
life
limit
locomotion
marketing
markets
method
Microsoft
muscle
nutrition
perfume
profits
shoot
sleep
style
tourism
appetite
apply
artifice
benefit
building
business
city
company
cosmetics
costume
data
design
designers
details
develop
Duties and responsibilities
entrepreneur
family
fashion
finery
food
hackers
hairstyle
health
jewelry
life
limit
locomotion
marketing
markets
method
Microsoft
muscle
nutrition
perfume
profits
shoot
sleep
style
tourism
anxiety
art
battle
beauty
calories
climbing
combustion
entertainment
exercise
food
future
gain
guide
life
suggest
activity
banks
business
earnings
economy
enterprise
Interest rate
investment
Make a profit
markets
Motor car
oil
plan
profits
shares
transact
valor
activity
banks
business
earnings
economy
enterprise
Interest rate
investment
Make a profit
markets
Motor car
oil
plan
profits
shares
transact
valor
administer
arthritis
company
design
designers
diet
drinks
entrepreneur
food
hackers
journey
limit
markets
menu
occupation
profits
publishers
restaurant
resume
retailers
sexy
shoot
sports
style
team
work
administer
arthritis
company
design
designers
diet
drinks
entrepreneur
food
hackers
journey
limit
markets
menu
occupation
profits
publishers
restaurant
resume
retailers
sexy
shoot
sports
style
team
work
anxiety
art
battle
beauty
calories
climbing
combustion
cosmetics
designers
entertainment
exercise
fashion
finery
food
future
gain
guide
life
locomotion
music
nutrition
photography
sleep
style
suggest
tourism
Anewcar
audi
champion
driver
Electricmachine
Electricpower
Mercedes

Como parte do desafio proposto pelo Vanilton lá no Agile Testers, resolvi escrever um pequeno post sobre a minha experiência com o Sikuli em um aplicativo mobile. A ideia não é ser um tutorial, mas tentarei passar alguns insights que tive ao me deparar com os desafios do projeto. Isso foi há quase 2 anos.

O Jogo

O aplicativo em questão era um jogo desenvolvido para a plataforma Tizen, o sistema operacional mobile da Samsung. Apesar de já ter superado o BlackBerry em market share no ano passado, o Tizen ainda é um ilustre desconhecido para a grande maioria de nós.

O jogo era uma versão para dispositivos móveis do famoso brinquedo Simon, um jogo de memória inventado em 1978 por Ralph H. Baer e Howard J. Morrison, com o desenvolvimento do software a cargo de Lenny Cope. Aqui no Brasil foi conhecido como Genius.

Para quem não viveu a época de ouro que foram os anos 80, o vídeo abaixo mostra um pouco do game play.

A Missão

Voltando ao projeto, a missão era simples: automatizar o jogo 😆 .

Nesse ponto, alguns já poderiam começar a se questionar: automatizar um jogo? Qual o sentido disso?

Sem querer entrar muito no mérito da questão, a necessidade veio da própria natureza do projeto: a não ser que você seja um prodígio da memória, é muito difícil memorizar sequências longas. Além disso, repetir o teste inúmeras vezes seria cansativo e maçante.

Sendo em Tizen, já era de se esperar a escassez de ferramentas de automação. Na época, cheguei a usar o excelente fmBT (Free Model Based Tool), mas esse não foi capaz de suprir todas as minhas necessidades. Então entra em cena o Sikuli.

Usando a ferramenta de captura do Windows foi possível recortar todos os ícones, botões e demais elementos gráficos do aplicativo. Portanto, considerando a aplicação instalada no emulador do Tizen, foi possível iniciá-la automaticamente por meio do Sikuli.

Dentre os recortes, destaco os dos botões:

Na fase de captura da sequência, precisei me concentrar nos botões iluminados. Eles que indicam o pressionamento de uma cor. No momento em que a sequência for reproduzida, o foco é nos botões não-iluminados. Para cada botão “on“, defini um padrão de similaridade.

Isso vai nos ajudar a verificar se esse recorte existe dentro uma imagem maior. Nesse caso, a imagem maior é um screenshot no momento exato em que o aplicativo seleciona uma cor e a acende. O ajuste na similaridade previne equívocos na hora do Sikuli encontrar uma determinada imagem. Para mais detalhes do Sikuli veja a série de posts no link.

A classe Robot do Java captura nosso screenshot.

Usei um contador no nome do arquivo para ter controle sobre cada screenshot, mas acredito que o nome poderia ser único.

Para localizar uma imagem contida em outra, é utilizado a classe Finder do Sikuli. Para procurar o recorte do botão vermelho dentro do screenshot, fiz uso do meu objeto definido lá no começo.

Se a cor é encontrada, já adiciono seu código a um ArrayList (chamado aqui de “sequence”). Dessa forma, poderei repetir a sequência mais tarde.

Como a sequência é gradual, isto é, na primeira passagem o aplicativo me desafia com uma cor, a qual devo repeti-la; na segunda passagem, são duas cores e assim sucessivamente, é só colocar tudo dentro de um loop.

A repetição da sequência é igualmente simples. Nesse caso, baseado no ArrayList, o botão vermelho que está apagado é clicado. O trecho de código para as outras cores é idêntico.

Dessa forma, mesmo nas sequências mais longas, o Sikuli foi capaz de reproduzi-las com maestria.

DesafioAgileTester

DesafioAgileTester

Compartilhe:

Deixe uma resposta

O seu endereço de email não será publicado