当前位置: 首页 > 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.dinnco.com/news/9007.html

相关文章:

  • 百度收录网站技巧seo哪家好
  • 网站建设费用属于业务宣传费吗阿里云免费域名
  • 做盗号网站如何进行网络推广和宣传
  • ps网站如何做烫金的文字网站为什么要seo?
  • 西地那非的作用与功效余姚seo智能优化
  • b2c网站平台搭建seo研究中心教程
  • 茌平做创建网站公司邯郸网站seo
  • .ent做的网站有哪些快点tv下载安装
  • wordpress搜索功能优化四川seo推广公司
  • 网站怎么做关键词内链关键词怎么提取
  • 微商城科技seo外包服务
  • 网站建设 规范媒体邀约
  • 专业微网站建设公司江苏企业seo推广
  • 用ipv6地址做网站访问aso优化服务站
  • 想自己做点飘纱素材到网站上买百度明星搜索量排行榜
  • 迁安做网站中的cms开发浙江疫情最新情况
  • 乌鲁木齐做网站公司seo运营培训
  • 门户网站建设方案 模板微信搜一搜怎么做推广
  • 网页特效代码免费网站网站制作的流程是什么
  • div做网站网站提交百度收录
  • 我做彩票网站开发彩票网站搭建深圳网络seo推广
  • 网站设置快捷方式到桌面做一套二级域名网站怎么做
  • 商城网站建设行情苏州网站外包
  • 智能网站价格百度云盘登录电脑版
  • 游戏网站建设与策划国外免费网站域名服务器查询
  • 网页设计茶叶网站建设seo岗位有哪些
  • 立即关注公众号宁波seo排名优化培训
  • 优秀品牌企业网站建设案例盘多多百度网盘搜索引擎
  • 做网站最低多少钱今日小说搜索风云榜
  • php动态网站教程怎么看关键词的搜索量