我想检查是否存在警报消息。为此我尝试了代码,
public boolean IsAlertPresent()
{
try
{
driver.switchTo().alert();
return true;
}
catch (NoAlertPresentException Ex)
{
return false;
}
}
Run Code Online (Sandbox Code Playgroud)
但是,错误消息显示在 boolean 和 IsAlertPresent() 中。Boolean 显示消息“标记“boolean”的语法错误,@预期”,IsAlertPresent() 显示消息“IsAlertPresent 无法解析为类型”。
我在 Jenkins 构建步骤中使用 here 标记通过 ssh 发送我的部署命令,不幸的是,即使 here 标记内的命令没有成功完成,构建也会通过:
ssh user@host <<EOF
cd /path/to/app
git pull
bower install
npm install
grunt build
cp -r /path/to/app/dist/* /path/to/dist/
forever restartall
exit
EOF
有没有更好的方法来解决这个问题?
deployment ssh automated-tests continuous-deployment jenkins
我是 Android 自动化领域的新手,我一直在研究 adb 命令来帮助我在物理设备上进行测试。
有没有办法通过 adb 更改被测设备的语言?
我找到了下面的命令:
adb shell am start -n com.android.settings/.Settings -e :android:show_fragment com.android.settings.LocalePicker
Run Code Online (Sandbox Code Playgroud)
没有工作。我还通过 shell 尝试过:
adb shell setprop persist.sys.language pt
Run Code Online (Sandbox Code Playgroud)
但它也没有奏效。
看起来页面对象模型和页面工厂正在做同样的事情。所以我很困惑。
IpmObjectInitializer initialize = new IpmObjectInitializer(driver.getWebDriver());
Run Code Online (Sandbox Code Playgroud)
// 初始化 BatchCreationPageFactory 类中的元素
batchCreationPageFactory = initialize.getBatchCreationPageFactoryObj();
Run Code Online (Sandbox Code Playgroud) 有没有一种方法可以自动检查Google Page Speed分数?
我正在尝试使用 spectron测试我的电子应用程序https://github.com/rafaelleru/torrent_player,我尝试在https://github.com/electron/spectron ant 中设置示例测试,它通过我的本地电脑但在 travis 中,我不知道如何设置要测试的 bin 文件,也不知道如何告诉 travis 生成 bin 文件。
这样做的正确方法是什么?
运行示例回归测试时出现以下错误:
TypeError: config.suite.split is not a function
Run Code Online (Sandbox Code Playgroud)
这是配置文件。看起来不错,但我一定错过了一些东西,但我无法诚实地找到它可能是什么。
Configuration.js 文件(这是几天前工作)
var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['PageObjectLocator2.js'],
capabilities: {
browserName: 'chrome'
},
onPrepare: function() {
browser.driver.manage().window().maximize();
jasmine.getEnv().addReporter(
new Jasmine2HtmlReporter({
savePath: 'target/screenshots'
})
);
},// end of onPrepare
suite:
{
Smoke : ['ChainLocator.js','dropDowns.js'],
Regression : 'nonAnuglarSpec.js'
},
//Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true, // Use colors in the command line report.
}
}
Run Code Online (Sandbox Code Playgroud)
这是 package.json 文件。可能是这里的问题,但老实说不知道
{
"name": "LocatorTraining",
"dependencies": { …Run Code Online (Sandbox Code Playgroud) 我是负载测试的初学者,我正在单页 Web 应用程序上使用 JMeter 进行负载测试。我现在面临的问题是,正如您在 SPA 中知道的那样,只有一个 URL 并且页面包含多个选项卡,我如何使用 JMeter 在选项卡之间切换。您可以在下图中看到我的测试计划。

我知道我知之甚少,欢迎提供任何链接或指南,因为谷歌关于 SPA 的信息有限。
testing automated-tests jmeter performance-testing single-page-application
由于严格通过前端自动化我们工作流程的某些部分的复杂性,我们需要在前端自动化测试运行之前发出 HTTP 请求以设置测试数据。
使用 TestCafe 文档,我尝试将一些东西拼凑在一起,当测试运行时,http 请求没有得到执行。这是我的代码:
import {Selector, ClientFunction, RequestHook, RequestLogger} from 'testcafe';
import https from 'https';
fixture `Call Create Test Move`
.before(async ctx => {
test('test', async t => {
const executeRequest = () => {
return new Promise(resolve => {
const options = {
method: 'POST',
uri: 'https://api.com/move/sample',
headers: {
"X-Company-Secret": "xxxxxxx",
"X-Permanent-Access-Token": "xxxxxxx"
},
body: {
companyKey: 'xxxxxx'
},
json: true
};
const req = https.request(options, res => {
console.log('statusCode:', res.statusCode);
console.log('headers:', res.headers);
resolve();
});
req.on('error', …Run Code Online (Sandbox Code Playgroud) 在某种情况下,当访问的页面具有超过 4k 个字符的 url 时,测试会冻结。在开发工具控制台中,我收到一些与 testcafe 中的一些 .js 文件相关的错误 (500),例如 task.js。如果我将 url 拆分为少于 3k 个字符,它就可以工作。这可以从一些配置文件中更改吗?谢谢。
javascript testing automated-tests browser-automation testcafe
automated-tests ×10
testing ×5
javascript ×3
selenium ×3
testcafe ×2
adb ×1
android ×1
appium ×1
deployment ×1
e2e-testing ×1
electron ×1
java ×1
jenkins ×1
jmeter ×1
node.js ×1
protractor ×1
python ×1
qa ×1
ssh ×1
travis-ci ×1
unit-testing ×1