Home > Python

Select value from drop-down in Selenium using Python

Sometimes we need to select a value from drop down in selenium. This drop down list can be of country, state, city etc.. In selenium using python, we can select values from drop-down using following sample code snippet: from selenium import webdriver. from selenium.webdriver.support.ui import Select. driver = webdriver.Chrome('D:\\chromedriver.exe') driver.get('url') select = Select(driver.find_element_by_id('Country')) # select by visible

This Article is TAGGED in . Read more

Python sample programs – Part 1

1. Calculate the Average of Numbers in a Given List count=int(input("Average of how many numbers do you want to find?")) a=[] for i in range(0,count): number=int(input("Enter number: ")) a.append(number) average=sum(a)/count print("Average of numbers is: ",average) Output: Average of how many numbers do you want to find?5 Enter number: 2 Enter number: 3 Enter

This Article is TAGGED in . Read more

Lists in Python

List is the most commonly used collection in Python. It is used to store list of variables which may have different data types. It is also useful to implement stacks and queues data structures. Variables can be dynamically stored using Lists. Following are some features of list 1. Lists are written

This Article is TAGGED in , . Read more