干嘛明年跳,现在就来啊,本司欢迎你,我这人就不怕 XDJM 们弱,就怕不想学、不会学
用 chrome 打开调试工具(F12),进入 console,输入:
alert(window.document.getElementById("mobile_file_url").getAttribute("value"));
如果你的网页有用jquery,那就这样写:
alert($("#mobile_file_url").val());
在jquery的前提下,如果这一句没结果,那就试试:
alert($("#mobile_file_url").eq(0).val());
如果有了结果,那就说明id使用重复,js或者jsp编译就应该有报错才对,可能被IDE给忽略掉了,找开发解决
如果以上操作,第一步弹出窗口有内容(就是那个 zip 的 url),那说明文档结构是没问题的,如果最终没有结果,那么还是要找开发去看,到底用了什么控件,是 flash 啊还是 SWFUpload 之类的什么鬼~
type=“hidden” 只是一个 “貌似为了” 防跨站攻击的隐藏域,用来记录一个随机串的吧,肯定于此无关,因为这根本不是 form 的属性,而是 form 的一个 childobject 而已
不妨换 xpath 试一下,如果 OK 了,说明前端有小 bug 或者结构太过复杂导致按照 id 无法查询到
单步等待的 API 封装,一般不赞成这么用
/**
* Description: set element locate timeout.</BR>
* 内容描述:设置对象查找超时时间.
*
* @param seconds
* timeout in timeunit of seconds.
*/
protected void setElementLocateTimeout(int seconds) {
driver.manage().timeouts().implicitlyWait(seconds, TimeUnit.SECONDS);
}
/**
* wait for the element visiable in timeout setting</BR>
* 在指定时间内等待,直到对象可见。
*
* @param by
* the element locator By
* @param seconds
* timeout in seconds
*/
protected boolean waitForElementVisible(By by, int seconds) {
try {
setElementLocateTimeout(seconds);
WebDriverWait wait = new WebDriverWait(driver, seconds, stepTimeUnit);
return wait.until(ExpectedConditions.visibilityOfElementLocated(by)) != null;
} finally {
setElementLocateTimeout(maxWaitfor);
}
}
/**
* wait for the element visiable in timeout setting</BR>
* 在指定时间内等待,直到对象可见。
*
* @param element
* the element to be found.
* @param seconds
* timeout in seconds.
*/
protected boolean waitForElementVisible(WebElement element, int seconds) {
try {
setElementLocateTimeout(seconds);
WebDriverWait wait = new WebDriverWait(driver, seconds, stepTimeUnit);
return wait.until(ExpectedConditions.visibilityOf(element)) != null;
} finally {
setElementLocateTimeout(maxWaitfor);
}
}
/**
* wait for the element not visiable in timeout setting</BR>
* 在指定时间内等待,直到对象不可见。
*
* @param by
* the element locator.
* @param seconds
* timeout in seconds.
*/
protected boolean waitForElementNotVisible(By by, int seconds) {
try {
setElementLocateTimeout(seconds);
WebDriverWait wait = new WebDriverWait(driver, seconds, stepTimeUnit);
return wait.until(ExpectedConditions.invisibilityOfElementLocated(by)) != null;
} finally {
setElementLocateTimeout(maxWaitfor);
}
}
/**
* wait for the element present in timeout setting</BR>
* 在指定时间内等待,直到对象出现在页面上。
*
* @param by
* the element locator.
* @param seconds
* timeout in seconds.
*/
protected boolean waitForElementPresent(By by, int seconds) {
try {
setElementLocateTimeout(seconds);
WebDriverWait wait = new WebDriverWait(driver, seconds, stepTimeUnit);
return wait.until(ExpectedConditions.presenceOfElementLocated(by)) != null;
} finally {
setElementLocateTimeout(maxWaitfor);
}
}
/**
* wait for the element clickable in timeout setting</BR>
* 在指定时间内等待,直到对象能够被点击。
*
* @param by
* the element locator By
* @param seconds
* timeout in seconds
*/
protected boolean waitForElementClickable(By by, int seconds) {
try {
setElementLocateTimeout(seconds);
WebDriverWait wait = new WebDriverWait(driver, seconds, stepTimeUnit);
return wait.until(ExpectedConditions.elementToBeClickable(by)) != null;
} finally {
setElementLocateTimeout(maxWaitfor);
}
}
/**
* wait for text appears on element in timeout setting</BR>
* 在指定时间内等待,直到指定对象上出现指定文本。
*
* @param by
* the element locator By
* @param text
* the text to be found of element
* @param seconds
* timeout in seconds
*/
protected boolean waitForTextOnElement(By by, String text, int seconds) {
try {
setElementLocateTimeout(seconds);
WebDriverWait wait = new WebDriverWait(driver, seconds, stepTimeUnit);
return wait.until(ExpectedConditions.textToBePresentInElementLocated(by, text)) != null;
} finally {
setElementLocateTimeout(maxWaitfor);
}
}
/**
* wait for text appears in element attributes in timeout setting</BR>
* 在指定时间内等待,直到指定对象的某个属性值等于指定文本。
*
* @param by
* the element locator By
* @param text
* the text to be found in element attributes
* @param seconds
* timeout in seconds
*/
protected boolean waitForTextOfElementAttr(By by, String text, int seconds) {
try {
setElementLocateTimeout(seconds);
WebDriverWait wait = new WebDriverWait(driver, seconds, stepTimeUnit);
return wait.until(ExpectedConditions.textToBePresentInElementValue(by, text)) != null;
} finally {
setElementLocateTimeout(maxWaitfor);
}
}
应该是,依赖的 JUnit、TestNG,把<scope>test</scope>
都删掉就行了
参考一下:http://www.it1352.com/313066.html
实际操作起来,我发现其实这种操作在【效果上】还是阻塞的,并非异步
为什么呢?换个角度思考,有了这个 timeout,你在下一个 page 加载完成之前的任何操作(包括断言),也会有同样的超时设置作用于对你的 element 的加载等待,除非你故意在下一步操作之前把超时时间设置为 1s 或者更短~
所以我在脚本中基本不动这个设置,只有在初始化的时候通过全局设置一下,结合自己系统、环境的性能表现即可。
嗯,连测试工程师这个岗位都撤消了还说啥呢
链接: https://pan.baidu.com/s/1i5qwsVN
密码: ddf8
我再说一次我去蚂蚁面试的事情,第二次去蚂蚁面试的时候面试题就有一张累积缺陷趋势图,让我来说一下这个项目有什么问题,当时我惊叹于这帮互联网屌丝居然也懂我传统业务的管理办法……那时候开始我以为阿里在这块有一整套的评估和监控体系在实行,现在看你的描述,应该也只是某些团队才会有吧。
按照我的经验三五个 release 是要的,然后开始预测,然后分析、优化参数,拍拍脑袋瞎估算一下,稳定下来至少要:
每个团队的业务类型、复杂度不一样,即便是同样的开发量,缺陷密度也不一样,所以,参数要具体到每个产品或者业务系统,分析的维度也可以多元化:按产品、按产品的 release、按开发团队、按测试团队……最后在一维分析的基础上再做二维、三维的分析,比如加上时间周期来看整体的趋势,这样在全年工作衡量乃至考核打分的时候都有点参考价值(这是大 M 的事)。
看样子你还是没好好琢磨透 webdriver 怎么工作的啊,给你个样例你看下:
每一步操作,工具都会自动等到你设置的超时时间(pageLoadTimeout、implicitlyWait)过了才会继续判定为失败,在此时间内会自动轮询检查的
对 ajax 局部刷新,一样有效
@Override
public void startWebDriver() {
cleanBrowserProcess();
try {
initWebDriver();
driver.manage().timeouts().pageLoadTimeout(maxLoadTime, TimeUnit.SECONDS);
driver.manage().timeouts().setScriptTimeout(maxWaitfor, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(maxWaitfor, TimeUnit.SECONDS);
driver.manage().window().maximize();
} catch (Exception e) {
LoggerUtils.error(e);
throw new RuntimeException(e);
}
}
丑便丑了,我再晒一图,我一直引以为傲的:
一个比较初级的版本供参考,说明:
我之前在平安科技做这个工作比较久,不过计算用存储过程搞的,推算出预期之后再来观察每天工作是否到位,我们的版本周期只有 15~30 天,所以周期上不会有太大差别
除了这个 Gompertz 之外,还有个 Rayleigh 模型,更精细,用于分阶段预测甚至推算线上 bug 数,至于效果么,我说两条:
图例:
再看下,到年底了,发生了什么
凡是带分支的测试都是不合格的测试,因为你想用一段代码囊括几个场景,包括有效的、无效的等价类,这是违背测试设计原则的:
所以,你的 test 不能太过纠结于 PO 还是 BOT,要把操作组件拆分清楚,比如
总之自动化测试也是测试,不要想着偷懒用 if else,select case 去覆盖,应该把每个分支做成一个@Test,换位思考,如果开发的代码里一大堆 if else 让你测试,你恼火不恼火~
节后 renew~
有意的可先私聊,聊完再决定投不投简历
我只会 apache 的 common-lang、lang3、beanutils,原生的不懂
人家只是想让你谈对线程安全的理解和程序设计时应该注意什么,而不是考察你会不会用 sync 这些,比如,直接回答注意不要用线程不安全对象、不要写静态方法……性能不好,影响体验这种话估计就是托辞吧,只是因为你没答到人家心坎上……若真如此,不去也是对的,这样的面试官很纠结于自己设定的答案,不够 open~
索引,值得每个 IT 从业者去深入研究学习一下,不过也不能说太多,碰到偏执狂把你问到底层算法去,就等于刨坑把自己埋了
老湿傅,我有个想法你看行不行得通
按照的 realtime-reporter 和 reportng 的思路,自己写个漂亮的前端,做成付费版的也去卖,会不会有市场?
再跟自己的测试框架平台撸在一起,卖给银行、券商这些土豪……想想就很开心,好多钱~
这……丑我认了,全是我自己手动布局一点点写的 css,没用框架
图也是我自己 P 的,除了一些存储过程,前后端都是我自己写的,需求和数学模型也是我找的……所谓全栈,大约说的就是我这种吧
struts2+jsp ——> SSM+Vue
估计你没仔细看帖子,extentreports 我这里没写,估计就是你说的所谓 extendreport 吧
帖子里有 reportng 和 realtime-report 两个,一个是事后汇总,一个是实时输出
回帖的人基本都在说 extentreports 如何优秀,然鹅,你们看不到 realtime 这个词么
优点:我格局高、见识多、善规划
缺陷:我说的这些我都不会啊,你可以请人来做
我是真不懂……因为我从来没有碰过移动端测试,图里面的点点点除外,所以我还是更欣赏这个图