@Test
    public void testAppServiceBilling() {
        // 登录
        login(be, getCommonStr("base_url"), getCustom(filekey, "billing_user"),
                getCustom(filekey, "billing_password"));
        be.click("//a[@id='af_billings']");
        if (be.isElementPresent("//table[@id='billingListTable']", 1000)) {
            double cal_total = 0.00;
            // 应用的计费检查，对每一行数据集， 天	* 单价(元/天)	= 小计 要成立
            // 除了最后一行的月总计外 ，其他都要做检查
            if (be.isElementPresent("//table[@id='appBilllingsTable']", 1000)) {
                RemoteWebDriver driver = be.getBrowserCore();
                List<WebElement> app_rows = driver.findElementsByXPath("//table[@id=\"appBilllingsTable\"]/tbody/tr");
                double app_total = 0.00;
                for (int i = 0, size = app_rows.size() - 1; i < size; i++) {
                    double day = Double.parseDouble(be.getText(String.format(
                            "//table[@id=\"appBilllingsTable\"]/tbody/tr[%s]/td[last()-2]", i)));
                    double dayprice = Double.parseDouble(be.getText(String.format(
                            "//table[@id=\"appBilllingsTable\"]/tbody/tr[%s]/td[last()-1]", i)));
                    double smalltotal = Double.parseDouble(be.getText(String.format(
                            "//table[@id=\"appBilllingsTable\"]/tbody/tr[%s]/td[last()]", i)));
                    assertThat(compare(mul(day, dayprice), smalltotal), is(0));
                    app_total = add(app_total, smalltotal);
                }

                // 当月总计
                double page_app_total = Double.parseDouble(be.getText(String.format(
                        "//table[@id=\"appBilllingsTable\"]/tbody/tr[%s]/td[last()]", app_rows.size())));

                assertThat(compare(app_total, page_app_total), is(0));
                logger.info("应用总计:" + app_total);
                cal_total = add(cal_total, app_total);
            }

            // 服务的计费检查，对每一行数据集， 天	* 单价(元/天)	= 小计 要成立
            // 除了最后一行的月总计外 ，其他都要做检查
            if (be.isElementPresent("//table[@id='appBilllingsTable']", 1000)) {
                RemoteWebDriver driver = be.getBrowserCore();
                List<WebElement> service_rows = driver.findElementsByXPath("//table[@id=\"serviceBillingTable\"]/tbody/tr");
                double service_total = 0.00;
                for (int i = 0, size = service_rows.size() - 1; i < size; i++) {
                    double day = Double.parseDouble(be.getText(String.format(
                            "//table[@id=\"serviceBillingTable\"]/tbody/tr[%s]/td[last()-2]", i)));
                    double dayprice = Double.parseDouble(be.getText(String.format(
                            "//table[@id=\"serviceBillingTable\"]/tbody/tr[%s]/td[last()-1]", i)));
                    double smalltotal = Double.parseDouble(be.getText(String.format(
                            "//table[@id=\"serviceBillingTable\"]/tbody/tr[%s]/td[last()]", i)));
                    assertThat(compare(mul(day, dayprice), smalltotal), is(0));
                    service_total = add(service_total, smalltotal);
                }

                // 当月总计
                double page_service_total = Double.parseDouble(be.getText(String.format(
                        "//table[@id=\"serviceBillingTable\"]/tbody/tr[%s]/td[last()]", service_rows.size())));

                assertThat(compare(page_service_total, page_service_total), is(0));
                logger.info("服务总计:" + service_total);
                cal_total = add(cal_total, service_total);
            }
            cal_total = round(cal_total, 2);
            // 应用总计+服务总计
            logger.info("应用总计+服务总计:" + cal_total);
        }
    }