drop down menu - Detect country name for dropdown using IP address in Selenium WebDriver using Java -
i started using selenium webdriver (java) automate e-commerce portal.
there dropdown in home page country names. based on ip address, country name should selected automatically.
how detect country name dropdown using ip address in selenium webdriver?
use geolocator such 1 found @ http://www.geobytes.com/iplocator.htm country name based on ip address.
then, find same value in dropdown list , add attribute "selected" it.
example if value returned "united kingdom":
<select name="country'> <input value="united states"> <input value="united kingdom" selected> </select>
do bear in mind list of countries or country names might vary, try stick standardized list of names.
unfortunately can't provide one. have implemented similar solution , found huge challenge acquire standard list of country names.
Comments
Post a Comment