Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8380889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:34:18+00:00 2026-06-09T16:34:18+00:00

I am trying to automate Google Soccer 2012 , just for fun. I did

  • 0

I am trying to automate Google Soccer 2012, just for fun. I did not have any problems automating other Google games.

The problem with Soccer is that it does not react to left and right, but space works just fine.

This is the entire script:

puts "Go to game."
require "bundler/setup"
require "watir-webdriver"
browser = Watir::Browser.new :chrome
browser.goto "https://www.google.com/doodles/soccer-2012"

sleep 1
puts "Go!"
browser.div(id: "hplogo").frame.div.click

sleep 1
puts "Left!"
browser.send_keys :left

sleep 1
puts "Rigth!"
browser.send_keys :right

sleep 1
puts "Space!"
browser.send_keys :space

You can see code for Soccer and other games at https://github.com/zeljkofilipin/olympics

Anybody has an idea how to get left and right working?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:34:20+00:00Added an answer on June 9, 2026 at 4:34 pm

    The goalie kind of moves a little if you hit the arrow key many times:

    100.times{browser.send_keys :left}
    

    Which makes me think that you need to some how hold down the arrow key rather than just tapping it. Unfortunately I could not find a way to hold keys down (the selenium-webdriver action builder key_down seems to only allow control keys).

    If you are okay with not using the keyboard, the goalie seems to respond well to the mouse:

    def move(browser, direction)
        el = browser.driver.find_element(:id, 'hplogo')
        case direction
            when :start
                browser.driver.action.move_to(el).perform
            when :left
                browser.driver.action.move_by(-1, 0).perform
            when :left_fast
                browser.driver.action.move_by(-5, 0).perform            
            when :right
                browser.driver.action.move_by(1, 0).perform
            when :right_fast
                browser.driver.action.move_by(5, 0).perform         
            when :jump
                browser.send_keys :space
        end
    end
    
    puts "Go to game."
    require "watir-webdriver"
    browser = Watir::Browser.new :chrome
    browser.goto "https://www.google.com/doodles/soccer-2012"
    
    sleep 1
    puts "Go!"
    browser.div(id: "hplogo").frame.div.click
    move(browser, :start) #Centre mouse
    
    sleep 1
    puts "Left!"
    80.times{move(browser, :left)}
    
    sleep 1
    puts "Right!"
    10.times{move(browser, :right_fast)}
    
    sleep 1
    puts "Space!"
    move(browser, :jump)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I´m trying to automate AZURE VM management like Amazon EC2. Is there any
I am trying to automate my trigger process so that I don't have to
I'm trying to automate the upload of a google app engine (java) project, there's
Im trying to automate video conversion with powershell and ffmpeg tool. Ffmpeg have detailed
With Google Apps API , While trying to automate the process of label creation
I'm trying to automate the Google Docs login process, but the methods that I
I am trying to automate google alerts.I am using c# to do this,I found
I am trying to automate upload file functionality in Google Drive. The element used
trying to automate using perl scripts on windows server using MediaWiki::Bot and Mediawiki::API taken
I'm trying to automate Mac OS X package building via command line interface of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.