过去,我们同时使用JWebUnit和HttpUnit对Web应用程序进行功能测试。他们两个在处理javascript时似乎都有问题。目前我们对测试javascript并不是特别感兴趣,但是自从我们在页面中添加了一些小的Ajax组件(例如Dojo日期/时间选择器)以来,JWebUnit和HttpUnit测试就已经失败了。
Selenium和Watir不适合使用,因为它们本质上是驱动浏览器,并且我们在不允许安装浏览器的盒子上从CruiseControl运行这些测试。
当使用具有不同服务器名称的虚拟主机时,是否可以使用xip.io访问本地网站?(我在Linux上,Fedora).
例如,假设我有3个可以在本地访问的网站,如下所示:
- http://localsite1
- http://localsite2
- http://localsite3
Run Code Online (Sandbox Code Playgroud)
我想通过xip.io与其他设备访问它们:
- http://localsite1.192.168.0.15.xip.io
- http://localsite2.192.168.0.15.xip.io
- http://localsite3.192.168.0.15.xip.io
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚如何使这项工作,甚至可能吗?
我已经使用CSS选择器在使用selenium webdriver时找到一个元素,但是找到下面div的元素似乎很难.
<div class="class1 class2" dd:btnfloatingstyle="top-right" dd:entitytexttype="resultval" id="_78891a36-3d75-432e-9906-760bd918e7cb" contenteditable="true"></div>
Run Code Online (Sandbox Code Playgroud)
为了使用css选择器查找元素,我通常会这样做:
$driver.find_elements(:css, 'div.classname')
Run Code Online (Sandbox Code Playgroud)
但是在这种情况下我有两个类名,而我在做的时候没有得到元素:
$driver.find_elements(:css, 'div.class1 class2') or
$driver.find_elements(:css, 'div.class1 > div.class2') or
$driver.find_elements(:css, 'div.class1 + div.class2')
Run Code Online (Sandbox Code Playgroud)
我错过了什么或者有没有其他方法可以找到这个元素?
我安装了VS.2017 Enterprise并启动了一个Web性能项目。当我尝试将Web性能测试添加到项目中时,出现以下错误:
“无法加载Web测试:无法从程序集'Microsoft.VisualStudio.QualityTools.WebTestFramework'Version = 10.0.0.0,..中加载类型'Microsoft.VisualStudio.TestTools.WebTesting.SharepointInformation'。”
我想测试我的网站应用程序的页面。但是,我有一个免责声明页面,您需要先接受该声明,然后才能访问实际的应用程序。在进行测试之前,有没有办法执行任务(在我的情况下单击“接受”按钮)。
目前,我的所有任务都失败了,因为它们无法通过页面。
谢谢。
我想检查我创建的页面上是否存在“64”。
const x = Selector('.FilterCockpit--header--count').withText('64');
Run Code Online (Sandbox Code Playgroud)
以下测试失败。
test('x', async t => {
await t
.expect((x).exists).ok()
});
Run Code Online (Sandbox Code Playgroud)
HTML 代码:
<div class="FilterCockpit--header--results">
<span class="FilterCockpit--header--count">
64
</span>
Results
</div>
Run Code Online (Sandbox Code Playgroud)
我做错了什么?预先感谢您的帮助。
我正在尝试写一些东西来检查以下页面上是否存在“关于我们”:https : //www.aggrowth.com/zh-cn/about-us,而我刚刚碰壁。这应该不难,但是我花了太多时间在这上面。
我们正在使用Gherking-testcafe:https ://www.npmjs.com/package/gherkin-testcafe
NPM: 6.9.0
TestCafe: 1.0.1
Gherking-Testcafe: 2.0.0
我尝试过(以下所有内容均经过测试隔离,也就是所有不同的t.expect均由他们自己运行):
const h1AboutUs = await Selector('h1');
await t.expect(h1AboutUs.innerText).eql('About Us');
await t.expect(h1AboutUs.innerText).contains('About Us');
await t.expect(h1AboutUs.value).eql('About Us');
await t.expect(Selector('html').textContent).contains('About Us');
Run Code Online (Sandbox Code Playgroud)
并尝试删除等待:
const h1AboutUs = Selector('h1');
await t.expect(h1AboutUs.innerText).eql('About Us');
await t.expect(h1AboutUs.innerText).contains('About Us');
await t.expect(h1AboutUs.value).eql('About Us');
await t.expect(Selector('html').textContent).contains('About Us');
Run Code Online (Sandbox Code Playgroud)
如果我这样做,它将起作用:
这是我的测试:
When("I see the page load", async t => {
const h1AboutUs = await Selector('h1');
await t.expect(h1AboutUs.visible).eql(true);
await t.hover(h1AboutUs);
await t.expect(h1AboutUs.value).contains('about');
console.log(h1AboutUs.value);
});
Run Code Online (Sandbox Code Playgroud)
我的testCafe赛跑者:
const createTestCafe = require('gherkin-testcafe');
const fs …Run Code Online (Sandbox Code Playgroud) automated-tests web-testing ui-automation e2e-testing testcafe
对于Ruby Web测试,是否有比WaTiR更好的单元测试工具?或者是事实上的标准?你使用什么单元测试工具?
integration-testing automated-tests web-testing watir functional-testing
在某些情况下,如果我评估 Selenium xpath/locator,我可以看到多个节点匹配。
示例://span[@username='xyz'](使用 Selenium 的示例代码)
如果上述相对路径与多个节点匹配(例如:找到 5 个匹配节点。找到下面的匹配节点列表)。
在 selenium 中,我可以使用像: (//span[@username='xyz'])[1] 访问找到的 5 个匹配项中的第一个匹配项。
我们如何使用 TestCafe 实现相同的目标?
我为 TestCafé 使用了“testcafe-browser.provider-browserstack”插件。我尝试在我的应用程序中使用它,但我总是收到一条消息,提示登录错误。数据是正确的(只是“测试”这篇文章)
const createTestCafe = require('testcafe');
const BrowserStack = require("testcafe-browser-provider-browserstack");
let testcafe = null;
process.env.BROWSERSTACK_USERNAME="test";
process.env.BROWSERSTACK_PASSWORD="test";
createTestCafe('localhost', 1337, 1338)
.then(tc => {
testcafe = tc;
const runner = testcafe.createRunner();
return runner
.src(['tests/fixture1.js', 'tests/ingo1.js'])
.browsers('browserstack:Chrome')
//.browsers(['chrome'])
.screenshots('allure/screenshots/', true)
.reporter('allure')
.run();
})
.then(failedCount => {
console.log('Tests failed: ' + failedCount);
testcafe.close();
});
Run Code Online (Sandbox Code Playgroud) automated-tests web-testing browserstack e2e-testing testcafe
web-testing ×10
e2e-testing ×5
testcafe ×5
testing ×2
apache ×1
browserstack ×1
c# ×1
html ×1
java ×1
javascript ×1
ruby ×1
virtualhost ×1
watir ×1
xpath ×1