• selenium+grid 似乎是支持多浏览器并发(我只需要在 chrome 上跑,好像无法解决,或是 gird 可以解决,只是我理解错了?)

    多浏览并发并没有说不能是多个 chrome 并发啊 只是你的 grid 里要设置好最大并发数(好像默认是 1 )

  • 卸载重装? 清除应用缓存数据? 云测平台?

  • 从测试的角度评估开发人员的能力:

    1. 业务理解:能否正确理解需求?实现的功能是否有遗漏?
    2. 逻辑思维:业务逻辑理解是否正确?实现的代码逻辑是否清晰?
    3. 产出物质量:设计文档是否完整? 提测的功能是否已经过自测、业务流程是否已跑通?
    4. 缺陷修复: 能否正确理解缺陷所描述的问题、定位到对应代码错误,并举一反三地修复相同的其他隐藏缺陷? 缺陷激活率有多高?(即同一个 bug 是否被多次重新打开)
    5. 缺陷率: 对应功能的缺陷数和用例数比例。

    如果我遇到一个开发人员存在上面若干项问题,就会将他作为重点对象,提醒测试人员对他所开发的功能特别留意,并把收集的问题反映给对应的开发主管。

  • q at March 20, 2019

    找份工资高的正职吧,牺牲自己本来就不多的休息时间来换取不会太高的收入,不值得。

  • 所以是需要把握重点的,那就是实现你的需求,到达你的目的。 至于基础、原理,回过头去看,会理解得更深。

  • 一种很有效的学习方式,就是开发出你想要的功能。 例如怎么帮你造数据,怎么帮你连数据库进行查询并导出为需要的格式,怎么帮你实现接口测试、自动化测试等。 抱着目的去找对应的实现方式。

  • 可能是不同版本的 selenium 的格式问题。

  • driver._switch_to.context()

    试下这个 , _switch_to

  • j 截图看下你完整的脚本吧, 错误提示说是 line 1 报错, 你截的是 49 行开始

  • 你这里是想写 insert 吗? 多检查一下语句格式吧

  • 怎样实际减轻手工测试,提升效率 : 你可以这么想,如果每次发新版都有 100 条用例需要回归,如果其中 30 条已经通过自动化执行,那么可以减轻你 30% 的工作;如果有多台测试设备需要执行,减轻的工作会更多。

    至于如何封装: 只要是重复的步骤,都可以封装起来给多个用例调用。 例如登录流程,基本上每个用例都可以需要调用的,就不用每个用例都写一遍登录的步骤,封装成公共方法来调用即可,而且方便维护。

  • 昨天大致按 第一种思路写了下面的测试脚本,不过后来发现页面上有些特殊的展示和取到的数据顺序不一样(例如 HK 和 TW 单独列了出来),所以脚本没完全跑通。 仅供参考吧:

    from selenium import webdriver
    from selenium.webdriver.common.by import By
    import time
    
    driver = webdriver.Chrome()
    driver.maximize_window()
    driver.get('https://www.millenniumhotels.com/en/hotels/')
    
    region_list = ["Asia", "Europe", "Middle East", "New Zealand", "United States"]
    
    target_country = [['China', 'Indonesia', 'Japan', 'Malaysia', 'Philippines', 'Singapore', 'Thailand'], ['France', 'Georgia', 'Italy', 'United Kingdom'], ['Iraq', 'Jordan', 'Kuwait', 'Oman', 'Palestine', 'Qatar', 'Saudi Arabia', 'Turkey', 'UAE'], ['New Zealand'], ['United States']]
    target_city = [[['Beijing', 'Chengdu', 'Fuqing', 'Hangzhou', 'Shanghai', 'Wuxi', 'Wuyishan', 'Xiamen', 'Zunyi', 'Hong Kong', 'Taichung', 'Hualien'], ['Jakarta'], ['Tokyo'], ['Cameron Highlands', 'Kuala Lumpur', 'Penang'], ['Manila'], [], ['Phuket']], [['Paris'], ['Tbilisi'], ['Rome'], ['Aberdeen', 'Birmingham', 'Cardiff', 'Dudley', 'Gatwick', 'Glasgow', 'Liverpool', 'London', 'Manchester', 'Newcastle', 'Plymouth', 'Reading', 'Sheffield', 'Slough']], [['Sulaimani'], ['Amman'], ['Al Jahra', 'Kuwait City'], ['Muscat', 'Mussanah', 'Salalah'], ['Ramallah'], ['Doha'], ['Hail', 'Madinah', 'Makkah', 'Riyadh'], ['Istanbul'], ['Abu Dhabi', 'Dubai', 'Sharjah']], [['Auckland', 'Bay of Islands', 'Dunedin', 'Greymouth', 'Hokianga', 'New Plymouth', 'Palmerston North', 'Queenstown', 'Rotorua', 'Taupo', 'Te Anau', 'Wairarapa', 'Wanganui', 'Wellington']], [['Anchorage', 'Boston', 'Boulder', 'Buffalo', 'Chicago', 'Cincinnati', 'Durham', 'Los Angeles', 'Minneapolis', 'Nashville', 'New York', 'Scottsdale']]]
    target_hotel = [[[['Grand Millennium Beijing', 'Millennium Residences @ Beijing Fortune Plaza'], ['Millennium Hotel Chengdu'], ['Millennium Hotel Fuqing'], ['Millennium Resort Hangzhou'], ['New World Millennium Hong Kong Hotel'], ['Millennium Gaea Resort Hualien'], ['Grand Millennium Shanghai HongQiao'], ['Millennium Hotel Taichung'], ['Millennium Hotel Wuxi'], ['Millennium Resort Wuyishan'], ['Millennium Harbourview Hotel Xiamen'], ['Millennium Hotel Zunyi']], [['Millennium Hotel Sirih Jakarta']], [['Millennium Mitsui Garden Hotel Tokyo']], [['Copthorne Hotel Cameron Highlands'], ['Grand Millennium Kuala Lumpur'], ['Copthorne Orchid Hotel Penang']], [['The Heritage Hotel Manila']], [], [['Millennium Resort Patong Phuket']]], [[['Millennium Hotel Paris Charles De Gaulle', 'Millennium Hotel Paris Opera']], [['The Biltmore Hotel Tbilisi']], [['Grand Hotel Palace Rome']], [['Copthorne Hotel Aberdeen'], ['Copthorne Hotel Birmingham'], ['Copthorne Hotel Cardiff-Caerdydd'], ['Copthorne Hotel Merry Hill-Dudley'], ['Copthorne Hotel Effingham Gatwick', 'Copthorne Hotel London Gatwick'], ['Millennium Hotel Glasgow'], ['Hard Days Night Hotel Liverpool'], ['Copthorne Tara Hotel London Kensington', 'Millennium and Copthorne Hotels at Chelsea Football Club', 'Millennium Gloucester Hotel London Kensington', 'Millennium Hotel London Knightsbridge', "The Bailey's Hotel London", 'The Chelsea Harbour Hotel'], ['Copthorne Hotel Manchester'], ['Copthorne Hotel Newcastle'], ['Copthorne Hotel Plymouth'], ['Millennium Madejski Hotel Reading'], ['Copthorne Hotel Sheffield'], ['Copthorne Hotel Slough-Windsor']]], [[['Copthorne Hotel Baranan', 'Grand Millennium Hotel Sulaimani', 'Millennium Kurdistan Hotel and Spa']], [['Grand Millennium Amman']], [['Copthorne Al Jahra Hotel & Resort'], ['Copthorne Kuwait City', 'Millennium Hotel and Convention Centre Kuwait']], [['Grand Millennium Muscat', 'Millennium Executive Apartments Muscat'], ['Millennium Resort Mussanah'], ['Millennium Resort Salalah']], [['Millennium Palestine Ramallah']], [['Copthorne Hotel Doha', 'Kingsgate Hotel Doha', 'Millennium Hotel Doha', 'Millennium Plaza Doha']], [['Millennium Hail Hotel Saudi Arabia'], ['Millennium Al Aqeeq Hotel', 'Millennium Madinah Airport', 'Millennium Taiba Hotel'], ['Copthorne Makkah Al Naseem', 'M Hotel Makkah by Millennium', 'Makkah Millennium Hotel', 'Makkah Millennium Towers', 'Millennium Makkah Al Naseem'], ['Copthorne Hotel Riyadh']], [['Millennium Istanbul Golden Horn']], [['Bab Al Qasr Hotel', 'Grand Millennium Al Wahda', 'Kingsgate Hotel Abu Dhabi by Millennium'], ['Copthorne Hotel Dubai', 'Grand Millennium Business Bay', 'Grand Millennium Dubai', 'M Hotel Downtown by Millennium', 'Millennium Airport Hotel Dubai', 'Millennium Al Barsha', 'Millennium Atria Business Bay', 'Millennium Place Marina', 'Millennium Plaza Hotel Dubai', 'Studio M Arabian Plaza'], ['Copthorne Hotel Sharjah']]], [[['Copthorne Hotel Auckland City', 'Grand Millennium Auckland', 'M Social Auckland'], ['Copthorne Hotel and Resort Bay of Islands', 'Kingsgate Hotel Autolodge Paihia'], ['Kingsgate Hotel Dunedin'], ['Kingsgate Hotel Greymouth'], ['Copthorne Hotel and Resort Hokianga'], ['Copthorne Hotel Grand Central New Plymouth', 'Millennium Hotel New Plymouth Waterfront'], ['Copthorne Hotel Palmerston North'], ['Copthorne Hotel & Apartments Queenstown Lakeview', 'Copthorne Hotel and Resort Queenstown Lakefront ', 'Millennium Hotel Queenstown'], ['Copthorne Hotel Rotorua', 'Millennium Hotel Rotorua'], ['Millennium Hotel and Resort Manuels Taupo'], ['Kingsgate Hotel Te Anau'], ['Copthorne Hotel & Resort Solway Park Wairarapa'], ['Kingsgate Hotel The Avenue Wanganui'], ['Copthorne Hotel Wellington Oriental Bay']]], [[['The Lakefront Anchorage'], ['The Bostonian Boston'], ['Millennium Harvest House Boulder'], ['Millennium Buffalo'], ['Millennium Knickerbocker Chicago'], ['Millennium Cincinnati'], ['Millennium Durham'], ['Millennium Biltmore Los Angeles'], ['Millennium Minneapolis'], ['Millennium Maxwell House Nashville'], ['Millennium Broadway New York Times Square', 'Millennium Premier New York Times Square'], ['The McCormick Scottsdale']]]]
    
    
    for i in range(len(region_list)):
        print('region is : %s' %region_list[i])
        driver.find_element_by_link_text(region_list[i]).click()
        time.sleep(5)
        # 获取城市列表
        country_list = driver.find_elements(by=By.CLASS_NAME, value='nk2-waterfall-country')
        print('country lenth: %d' % len(country_list))
        assert len(country_list)==len(target_country[i])
        for j in range(len(country_list)):
            country_name = country_list[j].find_element(by=By.CLASS_NAME, value='nk2-waterfall-country-name').text
            print('country name is : %s' %country_name)
            assert country_name==target_country[i][j]
    
            # 获取城市列表
            city_list = country_list[j].find_elements(by=By.CLASS_NAME,value='nk2-waterfall-city')
            print('city lenth: %d' %len(city_list))
            assert len(city_list) == len(target_city[i][j])
            if len(city_list):
                for k in range(len(city_list)):
                    city_name = city_list[k].find_element(by=By.CLASS_NAME,value='nk2-waterfall-city-name').text
                    print('city name is : %s' %city_name)
                    assert city_name==target_city[i][j][k]
    
                    hotel_list = city_list[k].find_elements(by=By.CLASS_NAME,value='nk2-waterfall-hotel-name')
                    print('hotel lenth in city %s : %d' %(city_name,len(hotel_list)))
                    assert len(hotel_list)==len(target_hotel[i][j][k])
                    for l in range(len(hotel_list)):
                        print(hotel_list[l].text)
                        assert hotel_list[l].text==target_hotel[i][j][k][l]
            else:
                hotel_list = country_list[j].find_elements(by=By.CLASS_NAME, value='nk2-waterfall-hotel-name')
                print('hotel lenth in country %s : %d' % (country_name, len(hotel_list)))
                assert len(hotel_list) == len(target_hotel[i][j][k])
                for l in range(len(hotel_list)):
                    print(hotel_list[l].text)
                    assert hotel_list[l].text == target_hotel[i][j][k][l]
    
    driver.quit()
    
    
  • 1 楼给出的接口验证方式是一种思路,可以做一下接口层面的验证。不过我觉得有两个问题:

    • 后台接口和前端展示的功能是分开的,所以接口数据没问题,不代表前端的展示也没问题。
    • 还需要验证接口数据是否完全一致,所以需要拿到一份完整的标准数据列表,然后拿接口返回数据解析后和标准数据列表进行对比验证。

    如果从 UI 的角度测试,建议思路有以下几种:

    • 同样拿到标准数据列表,然后在当前页面查找是否每个数据是否一致。完整的解决方案,需要 region-country-city - hotel 四级的数据都一致,才能既保证酒店都列出来了,也能保证数据的层级和顺序展示正确。
    • 另一种思路是通过截图,然后进行图像对比。如果两张图片的重合率达到标准(例如 99%),则基本能说明展示的数据是一致的。之前看到论坛里有类似的图片对比解决方案,可以查一下。
  • 可能是根据请求头里的的浏览器信息判断的

  • 关键字驱动?

  • 看你选的节点 ,还以为你要问怎么学 python

  • 逹先生 2018年 度总结 at March 13, 2019

    7 月份预产期了还这么安心计划出远门😂

  • 没有接触过长连接类型的这种情况,不过猜测除了返回正常的数据外,应该有个时间戳代表当前时间。 验证点除了数据格式外,时间延迟也是一个点,数据正确性就要想办法验证了(关键看具体的实现逻辑是怎么样,如果是实时查数据库,一种思路是先造数据插到数据库,然后验证返回的数据是否与期望的相同)

  • 1 秒刷新一次,是客户端的行为吗? 1 秒发起一次查询?

    还是说是长连接,服务端 1 秒发一次数据回来?

  • 和一般的接口有什么差别吗?

  • 同一份工作坚持几十年? 首先你确定这家公司能坚持几十年吗?

  • 想问下对于持续集成这块是怎么处理的?

  • 看一下 runalltest.py 文件的内容

  • 微信小程序 bug at February 28, 2019

    这是小游戏吧?

  • while i>=49:
          id=str(i+1)
    while beginID>=666:
          thirdParkId=str(beginID+i)
    

    另外看不懂这两段 while 的作用, 如果 i 和 beginID 满足条件,是会死循环跳不出去的吧? 感觉上你是不是想用 if ?