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

网站建设维护保密协议书设计网站排名

网站建设维护保密协议书,设计网站排名,福州网站建设报价,从零开始学做网站 网站插件安装搜插件selenium,安装添加config添加线程组右键线程组->添加->配置元件->jpgc - Chrome Driver Configoption和proxy不解释了添加Sampler右键线程组->添加->取样器->jpgc - WebDriver Samplerscript language 选择:JavaScript&…

插件安装

  • 搜插件selenium,安装

添加config

  • 添加线程组

  • 右键线程组->添加->配置元件->jp@gc - Chrome Driver Config

  • option和proxy不解释了

添加Sampler

  • 右键线程组->添加->取样器->jp@gc - WebDriver Sampler

  • script language 选择:JavaScript(可惜没有python)

  • 界面说明

  • Name - for the test that each Web Driver Sampler will have. This is used by the reports.

  • Parameters - is optional and allows the reader to inject variables used in the script section.

  • Script - allows the scripter to control the Web Driver and capture times and success/failure outcomes

DEMO代码及解释

https://jmeter-plugins.org/wiki/WebDriverSampler/
  • 示例代码

// 相当于python的from  import   java的importvar pkg = JavaImporter(org.openqa.selenium)// Start capturing the sampler timing 开始捕获取样WDS.sampleResult.sampleStart()// 代码块WDS.browser.get('http://114.116.2.138:8090/forum.php')
WDS.browser.findElement(pkg.By.id('ls_username')).sendKeys('admin')
// 等价于 WDS.browser.findElement(org.openqa.selenium.By.id('ls_username')).sendKeys('admin')WDS.browser.findElement(pkg.By.id('ls_password')).sendKeys('123456')
// js语法定义了一个 sleep函数 ,让你从python平滑过渡到 jsvar sleep = function(time) {var timeOut = newDate().getTime() + parseInt(time, 10);while(newDate().getTime() <= timeOut) {}
}WDS.browser.findElement(pkg.By.cssSelector('.pn.vm')).click()
sleep(3000)// 断言部分if(WDS.browser.getCurrentUrl() != 'http://114.116.2.138:8090/forum.php') {WDS.sampleResult.setSuccessful(false)WDS.sampleResult.setResponseMessage('Expected url to be XXX')
}
else{WDS.sampleResult.setSuccessful(true)
}// Stop the sampler timing 停止取样WDS.sampleResult.sampleEnd()
  • WDS就是Web Driver Sampler

  • 麻烦的是你可能并没有自动补齐(好像可以出来,但没研究),这个对象有哪些属性方法

  • 深入的研究要看

https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/package-summary.html
  • 比如显式等待的一个应用

var pkg = JavaImporter(org.openqa.selenium, org.openqa.selenium.support.ui)
var wait = new pkg.WebDriverWait(WDS.browser, 5, 0.5)
wait.until(pkg.ExpectedConditions.presenceOfElementLocated(pkg.By.cssSelector('ul.suggestions')))

关于WDS的一些属性

  1. WDS.name - is the value provided in the Name field (above).

  1. WDS.vars - JMeterVariables - e.g.

vars.get("VAR1"); vars.put("VAR2","value"); vars.remove("VAR3"); vars.putObject("OBJ1",new Object());

  1. WDS.props - JMeterProperties (class java.util.Properties) - e.g.

props.get("START.HMS"); props.put("PROP1","1234");

  1. WDS.ctx - JMeterContext

  1. WDS.parameters - is the value provided in the Parameters field (above).

  1. WDS.args - is an array of the strings provided in the Parameters field, but split by the space ' ' character. This allows the scripter to provide a number of strings as input and access each one by position.

  1. WDS.log - is a Logger instance to allow the scripter to debug their scripts by writing information to the jmeter log file (JMeter provides a GUI for its log entries)

  1. WDS.browser - is the configured Web Driver browser that the scripter can script and control. There is detailed documentation on this object on the Selenium Javadocs page.

  1. WDS.sampleResult - is used to log when the timing should start and end. Furthermore, the scripter can set success/failure state on this object, and this SampleResult is then used by the JMeter reporting suite. The JMeter javadocs provide more information on the API of this object

http://www.15wanjia.com/news/44156.html

相关文章:

  • 网站制作基础教程优秀软文范例100字
  • ps做网站页面设置为多大网络推广优化方案
  • 用dw做网站的基本步骤域名服务器ip地址查询
  • 两学一做网站条幅免费网站申请注册
  • 网站制作企业上海互联网公司排名
  • 专门做中式服装平台的网站大连网站优化
  • 利用百度图片做网站外链百度识图搜索
  • 南京便宜网站建设网络公司是做什么的
  • 网站开发公司面试题专业seo培训
  • 备案的博客网站可以做别的吗网站子域名查询
  • 二级域名怎么做网站备案网络推广运营推广
  • 推广网站注册赚佣金镇江百度seo
  • 微擎微网站开发贵阳网站建设推广
  • 厦门网站建设 php深圳营销推广公司
  • 做列表的网站做网站用什么软件好
  • 如何自己做网站知识百度搜索引擎优化的方法
  • 用java软件做网站举出最新的网络营销的案例
  • 沈阳网站制作公司南宁seo优化
  • 内贸在什么网站做怎么推广引流客户
  • 江西省上饶市建设局网站成都seo优化推广
  • 自媒体横行还有做网站友情链接交易网站
  • 做一件代发哪个网站好近日网站收录查询
  • 南阳哪里做网站比较好精准营销包括哪几个方面
  • 智能网站价格百度识图查另一半情头
  • 潮州专业网站建设制作360搜索引擎的特点
  • 杭州建站平台竞价推广sem
  • 百度站长工具怎么用网络营销策略名词解释
  • 中文企业网站模板htmlseo信息优化
  • 萍乡市建设局网站王丽电商网站排名
  • SEO参与网站建设注意博客seo怎么做