本文整理汇总了Java中com.surenpi.autotest.utils.StringUtils.isNotBlank方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.isNotBlank方法的具体用法?Java StringUtils.isNotBlank怎么用?Java StringUtils.isNotBlank使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.surenpi.autotest.utils.StringUtils
的用法示例。
在下文中一共展示了StringUtils.isNotBlank方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: search
import com.surenpi.autotest.utils.StringUtils; //导入方法依赖的package包/类
@Override
public WebElement search(Element element)
{
List<By> byList = new ArrayList<By>();
if (StringUtils.isNotBlank(element.getId()))
{
byList.add(By.id(element.getId()));
}
else if (StringUtils.isNotBlank(element.getCSS()))
{
byList.add(By.className(element.getCSS()));
}
else if (StringUtils.isNotBlank(element.getXPath()))
{
byList.add(By.xpath(element.getXPath()));
}
else if (StringUtils.isNotBlank(element.getLinkText()))
{
byList.add(By.linkText(element.getLinkText()));
}
else if (StringUtils.isNotBlank(element.getPartialLinkText()))
{
byList.add(By.partialLinkText(element.getPartialLinkText()));
}
else if (StringUtils.isNotBlank(element.getTagName()))
{
byList.add(By.tagName(element.getTagName()));
}
return cyleFindElement(byList);
}
示例2: visit
import com.surenpi.autotest.utils.StringUtils; //导入方法依赖的package包/类
@Override
public void visit(Element node)
{
if (!"locator".equals(node.getName()))
{
return;
}
String name = node.attributeValue("name");
String value = node.attributeValue("value");
String timeoutStr = node.attributeValue("timeout");
String extend = node.attributeValue("extend");
if(StringUtils.isBlank(name) || StringUtils.isBlank(value))
{
logger.error("locator has empty name or value.");
}
long timeout = 0;
if(StringUtils.isNotBlank(timeoutStr))
{
try
{
timeout = Long.parseLong(timeoutStr);
}
catch(NumberFormatException e){}
}
Map<String, Locator> beans = context.getBeansOfType(Locator.class);
Collection<Locator> locatorList = beans.values();
for(Locator locator : locatorList)
{
if(!name.equals(locator.getType()))
{
continue;
}
if(locator instanceof LocatorAware)
{
LocatorAware locatorAware = (LocatorAware) locator;
locatorAware.setValue(value);
locatorAware.setTimeout(timeout);
locatorAware.setExtend(extend);
absEle.getLocatorList().add(locator);
break;
}
}
}
示例3: runSuiteWithData
import com.surenpi.autotest.utils.StringUtils; //导入方法依赖的package包/类
/**
* 使用指定数据组来运行
* @param settingUtil
* @param row
* @param pageList
* @throws SecurityException
* @throws IllegalArgumentException
* @throws IllegalAccessException
* @throws InterruptedException
*/
@SuppressWarnings("unchecked")
private void runSuiteWithData(Phoenix settingUtil, int row, List<SuitePage> pageList)
throws SecurityException, IllegalArgumentException, IllegalAccessException, InterruptedException
{
Collection<DynamicDataSource> dynamicDataSourceList = settingUtil.getDynamicDataSources();
for(DynamicDataSource dynamicDataSource : dynamicDataSourceList)
{
Object dynamicParam = globalData.get(DATA_SOURCE_PARAM_KEY);
if(dynamicParam instanceof Map)
{
Map<String, Object> dataGlobalMap = dynamicDataSource.getGlobalMap();
if(dataGlobalMap != null)
{
dataGlobalMap.putAll((Map<? extends String, ? extends Object>) dynamicParam);
dataGlobalMap.putAll(settingUtil.getEngine().getDataMap());
}
}
}
settingUtil.initData(row);
this.progressInfo.setInfo(String.format("数据初始化完毕!共有[%s]个测试页面!", pageList.size()));
for(SuitePage suitePage : pageList)
{
String pageCls = suitePage.getPage();
Page page = (Page) settingUtil.getPage(pageCls);
if(page == null)
{
throw new RuntimeException(String.format("Can not found page [%s].", pageCls));
}
Object pageData = globalData.get(pageCls);
if(pageData instanceof Map)
{
@SuppressWarnings("unchecked")
Map<String, Object> pageDataMap = (Map<String, Object>) pageData;
page.putAllData(pageDataMap);
}
String url = page.getUrl();
if(StringUtils.isNotBlank(url))
{
page.open();
}
List<SuiteAction> actionList = suitePage.getActionList();
if(actionList == null)
{
actionList = new ArrayList<SuiteAction>();
}
this.progressInfo.setInfo(String.format("页面[%s]一共有[%s]个测试动作!开始测试!", pageCls, actionList.size()));
int repeat = suitePage.getRepeat();
repeat = repeat <= 0 ? 1: repeat;
for(int i = 0; i < repeat; i++)
{
performActionList(page, actionList, settingUtil);
}
}
}