Beispiel #1
0
def test_get_load_time(har_data):
    """
    Tests HarPage.get_load_time()
    """
    init_data = har_data('humanssuck.net.har')
    page = HarPage(PAGE_ID, har_data=init_data)

    assert page.get_load_time(request_type='GET') == 463
    assert page.get_load_time(request_type='GET', async=False) == 843
    assert page.get_load_time(content_type='image.*') == 304
    assert page.get_load_time(status_code='2.*') == 463
Beispiel #2
0
def test_get_load_time(har_data):
    """
    Tests HarPage.get_load_time()
    """
    init_data = har_data('humanssuck.net.har')
    page = HarPage(PAGE_ID, har_data=init_data)

    assert page.get_load_time(request_type='GET') == 463
    assert page.get_load_time(request_type='GET', asynchronous=False) == 843
    assert page.get_load_time(content_type='image.*') == 304
    assert page.get_load_time(status_code='2.*') == 463
Beispiel #3
0
import json
from haralyzer import HarPage

with open('b.har', 'r') as f:
    har_page = HarPage('page_1', har_data=json.loads(f.read()))

### WORK WITH LOAD TIMES (all load times are in ms) ###
# Link http://pythonhosted.org/haralyzer/haralyzer.html

entries = har_page.filter_entries()

#print(entries)

print(har_page.get_total_size(entries))

print(har_page.get_load_time(request_type='GET'))

print(har_page.total_load_time(request_type='GET'))
'''
# Audio Load Time
print(har_page.audio_load_time)

#Video Load Time
print(har_page.video_load_time)

#JS Load Time
print(har_page.js_load_time)

#Hostname
print(har_page.hostname)