Example #1
0
def refresh(driver):
    try:
        driver.refresh()
        time.sleep(1)
        print success + "Refreshed Browser at " + ("%s seconds" % (time.time() - start_time))
    except:
        print fail +"Unable to Refresh"
Example #2
0
def refresh(driver):
    try:
        driver.refresh()
        time.sleep(1)
        print success + "Refreshed Browser at " + ("%s seconds" %
                                                   (time.time() - start_time))
    except:
        print fail + "Unable to Refresh"
Example #3
0
def snapshot(driver, image_name):
    try:
        time.sleep(5)
        driver.implicitly_wait(20)
        driver.save_screenshot('./screens/' + image_name + '.png')
        print success + "Recorded screenshot " + "'" + image_name + '.png' + "'" + " after " + ("%s seconds" % (time.time() - start_time))
    except:
        print fail + "Unable to take a screenshot"

    return (time, driver, image_name)
Example #4
0
def snapshot(driver, image_name):
    try:
        time.sleep(5)
        driver.implicitly_wait(20)
        driver.save_screenshot('./screens/' + image_name + '.png')
        print success + "Recorded screenshot " + "'" + image_name + '.png' + "'" + " after " + (
            "%s seconds" % (time.time() - start_time))
    except:
        print fail + "Unable to take a screenshot"

    return (time, driver, image_name)
Example #5
0
def clickRetry (driver, css_selector):
    try:
        driver.find_element_by_css_selector(css_selector).click()
        time.sleep(1) #pause 1 second
        driver.implicitly_wait(20)
        print success + "Clicked on <" + css_selector + ">" + " at " + ("%s seconds" % (time.time() - start_time))
    except:

        driver.find_element_by_css_selector(css_selector).click()
        print fail + "Unable to locate " + css_selector + " and took screenshot of failure"
        driver.save_screenshot('screens/fails/unable-to-click-' + css_selector + '.png')
        driver.quit()

    return (driver, css_selector)
Example #6
0
def clickRetry(driver, css_selector):
    try:
        driver.find_element_by_css_selector(css_selector).click()
        time.sleep(1)  #pause 1 second
        driver.implicitly_wait(20)
        print success + "Clicked on <" + css_selector + ">"
    except:

        driver.find_element_by_css_selector(css_selector).click()
        print fail + "Unable to locate " + css_selector + " and took screenshot of failure"
        driver.save_screenshot('screens/clickretry-fail.png')
        driver.quit()

    return (driver, css_selector)
Example #7
0
def clickRetry (driver, css_selector):
    try:
        driver.find_element_by_css_selector(css_selector).click()
        time.sleep(1) #pause 1 second
        driver.implicitly_wait(20)
        print success + "Clicked on <" + css_selector + ">"
    except:

        driver.find_element_by_css_selector(css_selector).click()
        print fail + "Unable to locate " + css_selector + " and took screenshot of failure"
        driver.save_screenshot('screens/clickretry-fail.png')
        driver.quit()

    return (driver, css_selector)
Example #8
0
def clickRetry(driver, css_selector):
    try:
        driver.find_element_by_css_selector(css_selector).click()
        time.sleep(1)  #pause 1 second
        driver.implicitly_wait(20)
        print success + "Clicked on <" + css_selector + ">" + " at " + (
            "%s seconds" % (time.time() - start_time))
    except:

        driver.find_element_by_css_selector(css_selector).click()
        print fail + "Unable to locate " + css_selector + " and took screenshot of failure"
        driver.save_screenshot('screens/fails/unable-to-click-' +
                               css_selector + '.png')
        driver.quit()

    return (driver, css_selector)
Example #9
0
def pause(seconds):
    time.sleep(seconds)

    print success + "Paused Browser for " + str(seconds) + " seconds"

    return (time)
Example #10
0
def pause(seconds):
    time.sleep(seconds)

    print success + "Paused Browser for " + str(seconds) + " seconds"

    return (time)