标签: automated-tests

标记“boolean”上的语法错误,@预期

我想检查是否存在警报消息。为此我尝试了代码,

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 无法解析为类型”。

testing selenium automated-tests selenium-webdriver

0
推荐指数
1
解决办法
7583
查看次数

当 ssh 部署失败时,Jenkins 构建通过

我在 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

0
推荐指数
1
解决办法
2248
查看次数

Adb shell 命令更改设备语言?

我是 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)

但它也没有奏效。

android automated-tests adb appium

0
推荐指数
1
解决办法
7447
查看次数

selenium 中的页面对象模型和页面工厂有什么区别?

看起来页面对象模型和页面工厂正在做同样的事情。所以我很困惑。

IpmObjectInitializer initialize = new IpmObjectInitializer(driver.getWebDriver());
Run Code Online (Sandbox Code Playgroud)

// 初始化 BatchCreationPageFactory 类中的元素

batchCreationPageFactory = initialize.getBatchCreationPageFactoryObj();
Run Code Online (Sandbox Code Playgroud)

java testing selenium automated-tests selenium-webdriver

0
推荐指数
1
解决办法
1万
查看次数

0
推荐指数
1
解决办法
1534
查看次数

使用 Spectron 和 travis 测试电子应用程序

我正在尝试使用 spectron测试我的电子应用程序https://github.com/rafaelleru/torrent_player,我尝试在https://github.com/electron/spectron ant 中设置示例测试,它通过我的本地电脑但在 travis 中,我不知道如何设置要测试的 bin 文件,也不知道如何告诉 travis 生成 bin 文件。

这样做的正确方法是什么?

automated-tests unit-testing node.js travis-ci electron

0
推荐指数
1
解决办法
1214
查看次数

不断收到 TypeError: config.suite.split is not a function 在运行回归测试时

运行示例回归测试时出现以下错误:

    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)

javascript automated-tests protractor

0
推荐指数
1
解决办法
596
查看次数

SPA中的Jmeter负载测试

我是负载测试的初学者,我正在单页 Web 应用程序上使用 JMeter 进行负载测试。我现在面临的问题是,正如您在 SPA 中知道的那样,只有一个 URL 并且页面包含多个选项卡,我如何使用 JMeter 在选项卡之间切换。您可以在下图中看到我的测试计划。 在此处输入图片说明

我知道我知之甚少,欢迎提供任何链接或指南,因为谷歌关于 SPA 的信息有限。

testing automated-tests jmeter performance-testing single-page-application

0
推荐指数
1
解决办法
805
查看次数

使用 TestCafe 发出真实的 HTTP 请求

由于严格通过前端自动化我们工作流程的某些部分的复杂性,我们需要在前端自动化测试运行之前发出 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)

javascript testing automated-tests e2e-testing testcafe

0
推荐指数
1
解决办法
1458
查看次数

TestCafe:.navigateTo 方法访问的 URL 长度有限制吗?

在某种情况下,当访问的页面具有超过 4k 个字符的 url 时,测试会冻结。在开发工具控制台中,我收到一些与 testcafe 中的一些 .js 文件相关的错误 (500),例如 task.js。如果我将 url 拆分为少于 3k 个字符,它就可以工作。这可以从一些配置文件中更改吗?谢谢。

javascript testing automated-tests browser-automation testcafe

0
推荐指数
1
解决办法
54
查看次数