本文整理汇总了C#中RepoItemInfo.Exists方法的典型用法代码示例。如果您正苦于以下问题:C# RepoItemInfo.Exists方法的具体用法?C# RepoItemInfo.Exists怎么用?C# RepoItemInfo.Exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RepoItemInfo
的用法示例。
在下文中一共展示了RepoItemInfo.Exists方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VerifyExcelfileValues
//**********************************************************************
/// <summary>
/// Open excel file, verify content contains or not contains given string.
/// </summary>
public static void VerifyExcelfileValues(LxScriptItem item)
{
string strPath = item.getArgText();
string strFileName = strPath.Substring(strPath.LastIndexOf("/") + 1,strPath.Length - strPath.LastIndexOf("/") -1);
string mark = item.getArg3Text(); // flag=true, contains; flag=false, not contains.
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.FileName = "excel.exe";
startInfo.Arguments = " " + strPath;
System.Diagnostics.Process process = System.Diagnostics.Process.Start(startInfo);
RepoItemInfo targetCellInfo = new RepoItemInfo(repo.ExternalApp.FormExcel.TableEntityInfo.ParentFolder, "variableCell",
repo.ExternalApp.FormExcel.TableEntityInfo.Path + "/row/cell[@text='"+ item.getArg2Text() +"']",
10000, null, System.Guid.NewGuid().ToString());
Delay.Milliseconds(6000);
bool bExists = targetCellInfo.Exists();
process.Kill();
if(mark.Equals("True"))
Validate.AreEqual(bExists,true);
else
Validate.AreEqual(bExists,false);
}
示例2: VerifyNotContains
//**********************************************************************
/// <summary>
/// Verify the comoponet like List, Table and Tree not contains given items.
/// </summary>
public static void VerifyNotContains(LxScriptItem item)
{
object objComponet = item.getComponent();
RepoItemInfo objComponetInfo = item.getComponentInfo();
Type objType = objComponet.GetType();
if(objType.Name.ToString() == "List")
{
RepoItemInfo targetListItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableListItem",
objComponetInfo.Path + "/listitem[@accessiblename='"+ item.getArgText() +"']",
10000, null, System.Guid.NewGuid().ToString());
Validate.AreEqual(targetListItemInfo.Exists(),false);
}
if(objType.Name.ToString() == "Table")
{
RepoItemInfo targetCellInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableCell",
objComponetInfo.Path + "/row/cell[@text='"+ item.getArgText() +"']",
10000, null, System.Guid.NewGuid().ToString());
Validate.AreEqual(targetCellInfo.Exists(),false);
}
if(objType.Name.ToString() == "Tree")
{
int treeLevel = Convert.ToInt32(item.getArgText());
string strTreelevel = "";
for(int i = 1 ; i <= treeLevel; i++)
{
strTreelevel += "/treeitem";
}
RepoItemInfo targetTreeItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableTreeItem",
objComponetInfo.Path + strTreelevel +"[@accessiblename='"+ item.getArg2Text() +"']",
10000, null, System.Guid.NewGuid().ToString());
Validate.AreEqual(targetTreeItemInfo.Exists(),false);
}
}
示例3: Select_Item
//**********************************************************************
/// <summary>
/// Click to given items in the comoponet like List, Table and Tree.
/// </summary>
public static void Select_Item(LxScriptItem item)
{
object objComponet = item.getComponent();
RepoItemInfo objComponetInfo = item.getComponentInfo();
Type objType = objComponet.GetType();
//MessageBox.Show(objType.Name.ToString());
if(objType.Name.ToString() == "List")
{
RepoItemInfo targetListItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableListItem",
objComponetInfo.Path + "/listitem[@accessiblename='"+ item.getArgText() +"']",
10000, null, System.Guid.NewGuid().ToString());
Ranorex.ListItem targetListItem = targetListItemInfo.CreateAdapter<Ranorex.ListItem>(true);
targetListItem.Click();
}
if(objType.Name.ToString() == "Table")
{
RepoItemInfo targetCellInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableCell",
objComponetInfo.Path + "/row/cell[@text='"+ item.getArgText() +"']",
10000, null, System.Guid.NewGuid().ToString());
Ranorex.Cell targetCell = targetCellInfo.CreateAdapter<Ranorex.Cell>(true);
targetCell.Click();
}
if(objType.Name.ToString() == "Tree")
{
String Xpos = " ";
String Ypos = " ";
String sPoint ="0;0";
if((!(item.getArg3Text().Trim().Equals("")))&&(!(item.getArg4Text().Trim().Equals(""))))
{
Xpos = item.getArg3Text();
Ypos = item.getArg4Text();
sPoint =Xpos+";"+Ypos;
}
int treeLevel = Convert.ToInt32(item.getArgText());
string strTreelevel = "";
string strTreelevelCkb = "";
for(int i = 1 ; i <= treeLevel; i++)
{
strTreelevel += "/treeitem";
strTreelevelCkb += "/checkbox";
}
RepoItemInfo targetTreeItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableTreeItem",
objComponetInfo.Path + strTreelevel +"[@accessiblename='"+ item.getArg2Text() +"']",
10000, null, System.Guid.NewGuid().ToString());
if(targetTreeItemInfo.Exists())
{
Ranorex.TreeItem targetTreeItem = targetTreeItemInfo.CreateAdapter<Ranorex.TreeItem>(true);
targetTreeItem.Click(sPoint);
}
else
{
targetTreeItemInfo = new RepoItemInfo(objComponetInfo.ParentFolder, "variableTreeItem1",
objComponetInfo.Path + strTreelevelCkb +"[@accessiblename='"+ item.getArg2Text() +"']",
10000, null, System.Guid.NewGuid().ToString());
Ranorex.CheckBox targetTreeItemCkb = targetTreeItemInfo.CreateAdapter<Ranorex.CheckBox>(true);
targetTreeItemCkb.Click(sPoint);
}
}
}