예제 #1
0
    time.sleep(1)


def correct_device_id(new_value, old_value):
    device_id_field = browser.find_element_by_id(
        'StdSf45_DeviceIdentifier_txt')
    device_id_field.clear()
    device_id_field.send_keys(new_value)
    save_record = browser.find_element_by_id('liSave')
    save_record.click()
    time.sleep(1)
    print('{} updated to {}'.format(old_value, new_value))


counter = len(old)
x = 0
login(bot2, password)
set_site(target_site[1])
while x <= counter:
    try:
        x += 1
        device_search(old[x])
        correct_device_id(new[x], old[x])
    except IndexError:
        print('Device IDs corrected\nScript Complete')
        break
    except Exception as b:
        print('Error\n----> Moving to Next')
        continue

browser.quit()
예제 #2
0
    clone_name.clear()
    clone_name.send_keys(new_name)
    clone_description = browser.find_element_by_xpath('/html/body/form/div[7]/div[2]/div/table/tbody/tr[3]/td[2]/input')
    clone_description.clear()
    clone_description.send_keys(new_name)
    save_clone_update = browser.find_element_by_xpath('/html/body/form/div[7]/div[2]/div/table/tbody/tr[5]/td[2]/input')
    save_clone_update.click()


target_item_list = 'target_clone.csv'
col_names = ['clone_name']
data = pandas.read_csv(target_item_list, names=col_names)
clone_name = data.clone_name.tolist()

browser.implicitly_wait(60)
login(bot1, password)
set_site('Global Site Code')

counter = len(clone_name)
x = 0

while x <= counter:
    main_to_target = 'TEST_CABL_FSI_Monthly Cooler v2 by Aisle MAIN'
    clone_to_target = 'TEST_CABL_FSI_Monthly Cooler v2 by Aisle MAIN Clone'
    try:
        x += 1
        print('{} of {}'.format(x, counter))
        time.sleep(1)
        find_main(main_to_target)
        time.sleep(1)
        clone_main()
예제 #3
0
from spBot_Core.BotLogin import login, set_site, password, bot3, browser

login(bot3, password)