CURRENMONTH TAG in Automation Framework
/**
* @param input
* <CURRENTMONTH><CURRENTMONTH+1>
* @return Month "MM"
*/
private String currentMonth(String input) {
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Date now = new Date();
String temp = dateFormat.format(now);
String month = temp.split("/")[1];
input = input.toUpperCase();
if (input.length() == "<CURRENTMONTH>".length()) {
return month;
} else if (input.length() > "<CURRENTMONTH>".length()) {
String math = input.substring("<CURRENTMONTH".length(),
"<CURRENTMONTH".length() + 1);
String value = input.substring(input.indexOf(math) + 1,
input.length() - 1);
int m = 0;
if (math.equals("+")) {
m = (Integer.parseInt(month) + Integer.parseInt(value)) % 12;
} else if (math.equals("-")) {
m = (Integer.parseInt(month) - Integer.parseInt(value)) % 12;
m = Math.abs(m);
} else {
return "Operator error!";
}
if (m == 0) {
m = 12;
}
if ((m + "").length() == 1) {
month = "0" + m;
} else {
month = m + "";
}
return month;
} else {
return "The format of input value " + input + " is incorrect.";
}
}
CURRENMONTH TAG in Automation Framework的更多相关文章
- Automation Framework Design 自动化框架设计思想
从2007年到2017年,十年内自动化测试工具层出不穷,各种工具在运用一段时间之后,各个公司都会有测试架构师对于目前的自动化测试工具进行框架定制设计. 从惠普2007年GDCC推出的的WebDrivi ...
- 自动化框架Quantum Automation Framework+cucumber+perfecto
名词解释 Quantum: 一款基于JAVA的自动化框架,支持手机和桌面WEB的自动化测试.与cucumber和perfecto实现了整合,用于BDD自动化. Refer: http://projec ...
- Robot Framework + Pywinauto 框架实现Windows GUI Automation
Robot Framework is a generic test automation framework for acceptance testing and acceptance test-dr ...
- 5 Best Automation Tools for Testing Android Applications
Posted In | Automation Testing, Mobile Testing, Software Testing Tools Nowadays automated tests ar ...
- Robot Framework自动化测试(三)--- 封装系统关键字
之前对robotframework-ride了解的不多,后来知道了引入Selenium2Lirary库后可以做web UI自动化测试,但发现和python没啥关系,今天学习了封装系统关键字算是和pyt ...
- Robot Framework安装配置 Linux
Simple introduction Robot Framework is a generic test automation framework for acceptance testing an ...
- What is Data Driven Testing? Learn to create Framework
What is Data Driven Testing? Data-driven is a test automation framework which stores test data in a ...
- Robot Framework 快速入门_英文版
Copyright © Nokia Siemens Networks 2008 Licensed under the Apache License, Version 2.0 Table of Cont ...
- 10 Unit Testing and Automation Tools and Libraries Java Programmers Should Learn
转自:https://javarevisited.blogspot.com/2018/01/10-unit-testing-and-integration-tools-for-java-program ...
随机推荐
- JAVA集合类型(二)
JAVA集合类型 (现代的变量集群) watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0J ...
- HDU1863_畅通project【Prim】【并查集】
畅通project Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- 用LayerDrawable实现两个图片的叠加效果
Drawable[] layers = new Drawable[2]; layers[0] = new ColorDrawable(primaryColor); layers[1] = new Co ...
- poj1363——Rails
Description There is a famous railway station in PopPush City. Country there is incredibly hilly. Th ...
- Linux xhost命令详解
xhost 命令用途 控制什么人可以访问当前主机上的增强 X-Windows. 语法 xhost [ + | - ] [ Name ] "+"表示增加,"-"表 ...
- 安卓-活动Activity
Android有4大组件,活动 Activity,服务 Service ,广播接收器 Brostcast receiver,内容提供器 Content Provider 安卓活动的生命周期有7种, o ...
- MySQL日期数据类型和时间类型使用总结
转自: http://blog.chinaunix.net/space.php?uid=11327712&do=blog&id=32416 MySQL 日期类型:日期格式.所占存储空间 ...
- Django shortcut functions
django.shortcuts package提供提供帮助类和函数可以更便捷的操作MVC中的每一部分,包含: render(request, template_name,[dictionary],[ ...
- SVN 部分常用命令
1. svn status 提交前显示出本地文本和版本库文本的区别 [url=] L abc.c # svn已经在.svn目录锁定了abc.c M bar.c # bar.c的内容已经在本地修改过了 ...
- Windows 安装PostgreSQL
下载二进制包:https://www.enterprisedb.com/download-postgresql-binaries 直接解压到C盘 Microsoft Windows [版本 6.3.9 ...