Drive Google Map Address validation with Selenium WebDriver

How to use Selenium WebDriver to select and validate a Google Map address

Test Design:

Running the test steps in TestWise

Test Script:

elem = driver.find_element(:id, "user_address")
elem.clear
elem.send_keys("10 ruby new")
sleep 0.8 # wait for JavaScript dropdown to appear
elem.send_keys(:down)
sleep 0.5 # wait for JavaScript to select next address
elem.send_keys(:down)
sleep 0.5
elem.send_keys(:down)
sleep 0.5
elem.send_keys(:down)
sleep 0.5
elem.send_keys(:tab)
sleep 0.8 # wait for drop down to close and set GPS data
4.times { elem.send_keys(:down); sleep 0.5 }
class UserProfilePage < AbstractPage
def enter_user_address(addr)
elem = driver.find_element(:id, "user_address")
elem.clear
elem.send_keys(addr)
sleep 0.8
4.times { elem.send_keys(:down); sleep 0.5 } # select the 4th address
elem.send_keys(:tab)
sleep 0.8
end
end
user_profile_page = UserProfilePage.new(driver)
user_profile_page.enter_user_address("10 ruby new")

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store