当前位置: 首页 > news >正文

1g网站空间费用收录网站

1g网站空间费用,收录网站,网络会议有哪些软件,asp网站制作实例教程代码示例 下面的代码示例将讲解如何使用Ranorex API来编写代码模块,或者是使用用户代码来扩展录制的模块。 在代码中使用对象库 使用对象库等待UI元素 建立Adapter来访问更多的属性和方法 为对象库元素建立一组Adapter 使用Validate类 强制一个测试用例失败 设置aut…

代码示例
下面的代码示例将讲解如何使用Ranorex API来编写代码模块,或者是使用用户代码来扩展录制的模块。
在代码中使用对象库
使用对象库等待UI元素
建立Adapter来访问更多的属性和方法
为对象库元素建立一组Adapter
使用Validate类
强制一个测试用例失败
设置automation speed
访问测试用例和测试簇的上下文
高级代码示例
如果做基于图像的自动化
如何查找和比较图像
处理意外的对话框

在代码中使用对象库

C#
[TestModule(“D451F1D1-C347-4B58-939F-F6187642EB56”, ModuleType.UserCode, 1)]
public class UsingRepository : ITestModule
{
// Repository object to access UI elements 用来访问UI元素的对象库对象
MyFirstTestProjectRepository repo = MyFirstTestProjectRepository.Instance;
/// <summary>
/// Constructs a new instance.  创建一个新实例
/// </summary>
public UsingRepository()
{
// Do not delete – a parameterless constructor is required! 不要删,需要无参构造器
}
void ITestModule.Run()
{
Mouse.DefaultMoveTime = 300;
Keyboard.DefaultKeyPressTime = 100;
Delay.SpeedFactor = 1.0;
// Using Ranorex.Form adapter represented by ‘MyApp’  用Ranorex.Form adapter来表示MyApp
// ‘MyApp’ is used as a folder within the repository;  MyApp是对象库中的文件夹
// the ‘Self’ property returns an object of type Ranorex.Form self用来返回对象
// Activates application 激活应用
repo.MyApp.Self.Activate();
// Log ‘Active’ state 记录状态
Report.Info(repo.MyApp.Self.Active.ToString());
// Maximize, Minimize and Restore 最大化,最小化,复原大小
repo.MyApp.Self.Maximize();
repo.MyApp.Self.Minimize();
repo.MyApp.Self.Restore();
// Closes application 关闭应用
repo.MyApp.Self.Close();
// Using Ranorex.Button adapter represented by ‘ButtonAdd’
// Read and log value of ‘Text’ attribute
Report.Info(repo.MyApp.Buttons.ButtonAdd.Text);
// Press button 按下按钮
repo.MyApp.Buttons.ButtonAdd.Press();
// Read and log value of ‘Enabled’ attribute 读取并记录属性
Report.Info(repo.MyApp.Buttons.ButtonAdd.Enabled.ToString());
// Using Ranorex.RadioButton adapter
// represented by ‘GenderOption’
// Select radio button 选择radio button
repo.MyApp.GenderOption.Select();
// Accessing listitems of Ranorex.List adapter
// represented by ‘CategoryList’
IList<ranorex.listitem> listItems = repo.MyApp.CategoryList.Items;
foreach ( Ranorex.ListItem item in listItems )
{
Report.Info(item.Text + ” is member of CategoryList”);
}
// Using Ranorex.MenuItem to open ‘File’ menu
repo.MyApp.MenuItemFile.Select();
// Selecting sub menu item ‘Connect’
repo.FileMenu.Connect.Select();
// Read and log ‘Enabled’ state of menu item ‘Connect’
Report.Info(repo.FileMenu.Connect.Enabled.ToString());
}
}
VB.NET
Public Class UsingRepository
Implements ITestModule
‘ Repository object to access UI elements
Private repo As MyFirstTestProjectRepository = MyFirstTestProjectRepository.Instance
”’ <summary>
”’ Constructs a new instance.
”’ </summary>
‘ Do not delete – a parameterless constructor is required!
Public Sub New()
End Sub
”’ <summary>
”’ Performs the playback of actions in this module.
”’ </summary>
”’ <remarks>You should not call this method directly, instead pass the module
”’ instance to the <see cref=”TestModuleRunner.Run(ITestModule)”> method
”’ that will in turn invoke this method.</see></remarks>
Private Sub ITestModule_Run() Implements ITestModule.Run
Mouse.DefaultMoveTime = 300
Keyboard.DefaultKeyPressTime = 100
Delay.SpeedFactor = 1.0
‘ Using Ranorex.Form adapter represented by ‘MyApp’
‘ ‘MyApp’ is used as a folder within the repository;
‘ the ‘Self’ property returns a Ranorex.Form object
‘ Activates application
repo.MyApp.Self.Activate()
‘ Log ‘Active’ state
Report.Info(repo.MyApp.Self.Active.ToString())
‘ Maximize, Minimize and Restore
repo.MyApp.Self.Maximize()
repo.MyApp.Self.Minimize()
repo.MyApp.Self.Restore()
‘ Closes application
repo.MyApp.Self.Close()
‘ Using Ranorex.Button adapter represented by ButtonAdd’
‘ Read and log value of ‘Text’ attribute
Report.Info(repo.MyApp.Buttons.ButtonAdd.Text)
‘ Press button
repo.MyApp.Buttons.ButtonAdd.Press()
‘ Read and log value of ‘Enabled’ attribute
Report.Info(repo.MyApp.Buttons.ButtonAdd.Enabled.ToString())
‘ Using Ranorex.RadioButton adapter
‘ represented by ‘GenderOption’
‘ Select radio button
repo.MyApp.GenderOption.[Select]()
‘ Accessing listitems of Ranorex.List adapter
‘ represented by ‘CategoryList’
Dim listItems As IList(Of Ranorex.ListItem) = repo.MyApp.CategoryList.Items
For Each item As Ranorex.ListItem In listItems
Report.Info(item.Text & ” is member of CategoryList”)
Next
‘ Using Ranorex.MenuItem to open ‘File’ menu
repo.MyApp.MenuItemFile.[Select]()
‘ Selecting sub menu item ‘Connect’
repo.FileMenu.Connect.[Select]()
‘ Read and log ‘Enabled’ state of menu item ‘Connect’
Report.Info(repo.FileMenu.Connect.Enabled.ToString())
End Sub
End Class
 

http://www.yidumall.com/news/19530.html

相关文章:

  • 网站开发协议中的注意事项百度一下百度首页登录
  • 人民日报客户端怎么投稿seo是啥意思
  • 环球旅行社网站建设规划书网络推广好做吗多少钱
  • 联系方式 响应式网站网络营销策划书格式
  • 办公用品网站建设策划书独立站优化
  • 做互助盘网站百度官方网
  • c asp.net 发布网站爱站长尾词
  • 公司app开发seo优化工作内容
  • 4大门户网站腾讯新闻发布平台
  • 做网站那里做可靠企业网站seo案例
  • 转行做网站新闻头条今日新闻下载
  • vultr 做网站空间肇庆网站推广排名
  • wordpress网站换字体百度seo点击软件
  • 站长工具alexa排名绍兴seo网站优化
  • python怎么做网站seo关键词排名优化是什么
  • 网站如何做宣传推广深圳海外推广
  • 上海频道网站建设电工培训内容
  • 做展馆的公司有哪些北京seo案例
  • 桂林app开发公司搜索引擎内部优化
  • 上海疫情通报最新郑州seo优化外包公司
  • 专门做毕业设计的网站免费手机网页制作
  • 提高网站排名的方法搜索引擎优化seo方案
  • 17858833595做网站网络营销的常用方法有哪些
  • 企业展厅设计公司可靠吗厦门seo测试
  • 成都网站制作scgckj如何免费制作自己的网站
  • 企查查官网查企业网页版怎么优化百度关键词
  • 绍兴建设局网站网站页面优化方法
  • 电商网站开发哪里好哪个浏览器看黄页最快夸克浏览器
  • 网站美工设计培训学校手机优化大师官网
  • 电子游艺网站开发站长工具seo综合查询访问