Add check taht exists any collection in create_collection functions

This commit is contained in:
cesar991 2016-07-20 15:36:20 +02:00
parent 1e91706ec1
commit 8e1735ec7e
1 changed files with 6 additions and 1 deletions

View File

@ -12,7 +12,12 @@ import string
def create_collection(driver,name,short_name,group="All",description=None):
click_menu_element(driver,"Collections")
driver.find_element_by_id("submit-crt").click()
if ("A file collection is a group of files (e.g. scripts or executables)" in driver.page_source) == True:
driver.find_element_by_xpath('//*[@id="main"]/div[2]/div[2]/form/input').click()
else:
driver.find_element_by_id("submit-crt").click()
driver.find_element_by_id("text-name").clear()
driver.find_element_by_id("text-name").send_keys(name)