Python 和Selenium统计jira

本文介绍了一个Python程序,它结合Selenium库自动从Excel获取查询条件,统计Jira中的数据,并将结果存回Excel。程序首先打开并登录Jira,应用JQL查询,然后统计并记录Jira问题详情。
摘要由CSDN通过智能技术生成

我最近写了一个Python程序,自动提取Excel数据,用Selenium统计Jiras数据,并写入Excel。

1.openPage
打开并登录Jira,打开需统计的jira的页面,页面的search文本框,输入查询条件,就是sql语句,在jira中,叫做 jql.

2.statistic
统计jira数据,并写入Excel。
从Excel读取要搜索的条件:读取这个 sheet :“JiraData”
读取jira页面的记录总数,写入 Excel的 sheet:Sum
遍历jira中的bug 表格,并写入Excel的各个 sheet。

# -*- coding: utf-8 -*-
from selenium import webdriver
from time import sleep
from selenium.webdriver.common.by import By
import Write_excel

wr = Write_excel.Write_excel('SasaiBugStatistic.xlsx')
sheetNames=['PaymentProduct','LiveProduct','OthersProduct','AllProduct','PaymentPreProduct','LivePreProduct','OthersPreProduct','AllPreProduct']
driver = webdriver.Chrome()

def openPage():
    i = 2
    driver.get("http://***:36808/login.jsp")
    sleep(2)
    el = driver.find_element(By.ID, "login-form-username")
    el.send_keys("***")
    el = driver.find_element(By.ID, "login-form-password")
    el.send_keys("***")
    el = driver.find_element(By.ID, "login-form-submit")
    el.click()
    sleep(5)
    urlSearch = "http://202.104.66.150:36808/issues/?jql=project%20in%20(CUB%2C%20ANDROIDUAT%2C%20IOSUAT%2C%20ANDROIDPRO%2C%20BACKENDPRO%2C%20IOSPROD)%20AND%20status%20in%20(Open%2C%20%22To%20Do%22%2C%20Reopened)%20AND%20affectedVersion%20in%20(%222.9.17%20production%22%2C%20%222.9.18%20%20production%22%2C%20%222.9.18%20production%22%2C%20%222.9.19%20%20production%22%2C%20%222.9.19%20production%22%2C%20%222.9.20%20%20production%22%2C%20%222.9.20%20production%22%2C%20%222.9.21%20%20production%22%2C%20%222.9.21%20production%22%2C%20%222.9.22%20%20production%22%2C%20%222.9.22%20production%22%2C%20%222.9.23%20%20production%22%2C%20%222.9.23%20production%22%2C%20%222.9.24%20Production%22%2C%20%222.9.25%20Production%22%2C%20%222.9.26%20production%22%2C%20%222.9.27%20production%22%2C%20%222.9.28%20Production%22%2C%20%222.9.29%20Production%22%2C%20%222.9.30%20production%22)%20AND%20component%20in%20(%22EcoCash%20Wallet%20APP%22%2C%20Remittances%2C%20%22Sasai%20Wallet%20APP%22%2C%20%22Sasai%20Wallet%20Management%20portal%22%2C%20%22Sasai%20Wallet%20Merchant%20portal%22%2C%20Wallet)%20ORDER%20BY%20created%20ASC%2C%20status%20ASC%2C%20summary%20ASC%2C%20affectedVersion%20ASC"
    driver.get(urlSearch)

def statistic():
    row = 3
    sheetIndex 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值