标签: automated-tests

在Flex应用程序上自动化QA

我有一个需要测试的Flex应用程序,我们的QA部门非常喜欢使用某种形式的自动测试工具,如HP的QuickTest Pro(QTP).但是,QTP要求您编写一些自定义代码,如果您希望自动化一些自制组件...不幸的是,我们有一些第三方组件,我们没有源代码,所以我们不能没有真正的自定义代码没有拥有第三方组件的源代码.

是否有任何现有的框架和/或工具可以让我自动化测试,而无需编写可供非程序员使用的自定义代码(即一个不知道指针是什么的QA人)

我已经快速浏览了Flex-Monkey(一个免费的开源软件),这似乎是一个很有前景的项目,但它还处于初期阶段,我很快就需要一些东西(即昨天)

有任何想法吗?

apache-flex automated-tests qa qtp flexunit

22
推荐指数
2
解决办法
9802
查看次数

VS 2010编码UI测试 - 启动参考应用程序

每次在我的TFS服务器上运行构建时,我都在使用Visuial Studio的编码UI测试在WPF应用程序上运行自动UI测试.我遇到的问题是根据它刚刚构建的路径动态启动可执行文件,包括配置(x86,x64).

有没有办法在引用的项目中获取可执行文件的路径,以便我可以从我的测试项目中动态启动应用程序?

automated-tests visual-studio-2010 coded-ui-tests

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

我应该如何在Java中测试私有方法?

可能重复: 单元测试私有方法的最佳方法是什么?

我是初学程序员,我不知道如何编写一个结构良好的单元测试应用程序.我想编写能够在之后添加有效单元测试的应用程序.

问题在于private方法 - 它们无法在类之外进行测试.

我应该改变是所有的方法解决这个问题privateprotected,让测试类扩展源类?或者有更好的解决方案吗?

我的解决方案(private splitLetters => protected splitLetters)将如下工作:

来源类:

class MyClass{
  protected splitLetters(int num){
    return num+2;
  }
}
Run Code Online (Sandbox Code Playgroud)

测试类:

class Test_MyClass extend MyClass{
  public splitLettersTest(){
  for(int i=0;i<100;i++){
    System.println(parent.splitLetters(i));
  }
 }
}
Run Code Online (Sandbox Code Playgroud)

解决方案:

  1. 不测试私有方法 - 有时私有方法正在执行非常复杂的任务,应该进行非常好的测试,我们不希望该用户可以访问这些方法.很快,解决方案就是将私有方法改为受保护.

  2. 嵌套类测试方法 - 有问题,因为QA在源代码中进行了更改

  3. 反思 - 如果这可以调用私有方法,它看起来像一个很好的解决方案http://www.artima.com/suiterunner/private3.html (我应该学习更多来理解反射.我不明白反射如何做如果我们可以从另一个类调用私有方法,那就不要破坏拥有公共和私有方法的所有想法.)

  4. 没有定义私有方法(正如我在我的解决方案中所示) - 有问题,因为有时我们必须定义私有方法.

java testing junit automated-tests unit-testing

22
推荐指数
2
解决办法
4万
查看次数

自动测试CSS和HTML前端编码

我是一名编写CSS,HTML和Javascript的前端开发人员(按此顺序),我所做的大部分工作都是设计领导.虽然我用CSS创建的设计质量是主观的,但是大部分编码都是纯粹的功能/布局,我对任何自动化测试页面感兴趣.

我的问题可以分为两部分

  1. 有没有人有自动测试CSS或HTML的任何现有技术或建议,特别是在跨浏览器兼容性方面?

  2. 由于CSS大致可分为控制布局的属性和控制设计的属性,因此自动测试仅适用于 布局(例如,不能自动且有价值地测试颜色是否正确)?如果是这样,哪种CSS值可能适合布尔验收测试?

以下是我可以测试的布尔值布局值的初始示例 - 必须有其他值吗?

  • 弹出窗口是否出现在其他内容之上(z-index)
  • 页脚是否清除所有其他内容(浮动)

谢谢你的帮助.问题的第三部分当然是"我是否在浪费时间沿着这条路走下去?".

*****编辑*****

我发现这篇文章询问了我提出的相同问题,但更深入,也许更有说服力.

http://www.morethanseven.net/2008/10/13/unit-testing-css-looking-solution/

继续前进我试图从我的工作中分离一些例子,其中CSS单独导致功能错误,但到目前为止我发现的那些是JS CSS组合的错误.我仍然想自动测试这些类型的错误,但是感谢使用javascript它超出了我原来的问题的范围.

*****编辑2*****

我已经写过关于如何解决这个问题的博客,可以在这里找到:

http://blog.ajcw.com/2010/12/automated-css-testing-or-how-one-css-coder-is-now-responsible-for-breaking-%E2%80%93-and-fixing - %E2%80%93最构建/

html css automated-tests unit-testing cross-browser

22
推荐指数
2
解决办法
2万
查看次数

如何使用Visual Studio 2013 Professional分析单个单元测试的性能?

我想运行Visual Studio 2013专业版分析器进行单个自动化测试.关于如何使用专业版,这里的其他问题尚不清楚.

这是可能的,如果是的话,怎么样?

profiling automated-tests unit-testing visual-studio-2013

22
推荐指数
2
解决办法
7260
查看次数

由于"进程崩溃",仪表运行失败.

我想运行以下测试:

package com.xxx.yyy;

import android.content.Context;
import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
 * Instrumented test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
    @Test
    public void useAppContext() {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getTargetContext();

        assertEquals("com.xxx.yyy", appContext.getPackageName());
    }
}
Run Code Online (Sandbox Code Playgroud)

但我在控制台中收到错误:

$ adb shell am instrument -w -r   -e debug false -e class 'com.xxx.yyy.ExampleInstrumentedTest' com.xxx.yyy.test/android.support.test.runner.AndroidJUnitRunner
Client not ready yet..
Started running …
Run Code Online (Sandbox Code Playgroud)

testing android automated-tests

22
推荐指数
4
解决办法
6797
查看次数

Pex用户:您对Pex和自动化探索性测试的印象如何?

那些使用Pex的人,您认为Pex作为工具的优点和缺点是什么?

另外,作为 TDD /单元测试的补充,您认为"自动化探索性测试"的优缺点是什么?

testing automated-tests unit-testing pex

21
推荐指数
4
解决办法
1576
查看次数

在Selenium IDE中,如何获取基本URL的值

是否可以从Selenium脚本(Selenium IDE中的纯HTML保存脚本)中检索基本URL的值?

我要做的是验证当前的URL使用assertLocation.但是assertLocation返回绝对网址.我想将当前网址与相对网址进行比较,而不必*在网址的开头使用.

我想访问基本字符串,因为我希望能够在不同的站点(各种开发站点+生产站点)上运行测试,但如果我使用的话,*我无法检查根页面(*/将是真的对于以/... 结尾的每个页面

这就是我目前所做的事情:

| assertLocation |*/some-page | |

这就是我想做的事情:

| assertLocation | baseURL +"/ some-page"| |

注意:甚至可以:

  1. 在目标中使用变量;
  2. 连接变量和字符串?

testing selenium automated-tests selenium-ide

21
推荐指数
2
解决办法
2万
查看次数

org.openqa.selenium.firefox.NotConnectedException:45000 ms后无法连接到端口7055上的主机127.0.0.1

我正在尝试运行从Selenium IDE导出的Junit测试用例.我超越了异常.我正在使用Windows XP,Firefox 20.0.1,并使用selenium-server-standalone-2.28.0.jar.Upon运行,打开一个空白的Firefox窗口.当我关闭该窗口时,我在控制台中得到以下异常

 org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms at
 org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:96)
 at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:142)
 at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:80)
 at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:121)
 at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:77)
 at com.dci.dids.selenium.SwamiRoleCreationTestCase.setUp(SwamiRoleCreationTestCase.java:20)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
 at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
 at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
 at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
 at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
 at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
 at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
 at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
 at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
 at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
 at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Run Code Online (Sandbox Code Playgroud)

JUnit Failure跟踪中的此异常

 org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/usr/bin/firefox) on …
Run Code Online (Sandbox Code Playgroud)

junit automated-tests selenium-rc

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

XPath中的.//和//*有什么区别?

通过Firebug找到相对的XPath:它创建了类似的

  1. .//*[@id='Passwd']---------如果我们在开始时不使用dot表示什么呢?

  2. 只需添加//*Xpath - 它突出显示---各种页面元素----------它表示什么?

以下是Gmail密码字段的XPath.有什么意义*

  • .//*[@id='Passwd']

  • //child::input[@type='password']

xml selenium xpath automated-tests selenium-webdriver

21
推荐指数
2
解决办法
5万
查看次数