Tag: webdriver

鉴于以下文件结构,如何运行基本的量angular器testing?

我一直在试图按照这里给出的教程。 但是,当我尝试开始量angular器testing,没有testing似乎运行。 然而,我的webdriverpipe理器似乎运行完美。 基本上没有任何反应。 我已经尝试了以下内容: node protractor conf.js node node_modules/protractor conf.js node node_modules/protractor node_modules/protractor/conf.js node node_modules/protractor node_modules/protractor/tests/conf.js 这些工作都没有,第一个抛出一个错误。 我试图把文件的副本放在多个目录中,但是这些文件都不起作用。 我不确定问题是什么,但这是多less文件设置。 ui_directory/ <– This is the overall directory for my web projects ui_directory/conf.js ui_directory/todo-spec.js ui_directory/node_modules/ ui_directory/node_modules/protractor/ ui_directory/node_modules/protractor/conf.js ui_directory/node_modules/protractor/todo-spec.js ui_directory/node_modules.protractor/tests/ ui_directory/node_modules.protractor/tests/conf.js ui_directory/node_modules.protractor/tests/todo-spec.js 究竟是从教程中运行testing的正确命令是什么? 所有的todo-spec.js和conf.js文件都是一样的。 我的conf.js文件包含以下内容: exports.config = { seleniumAddress: 'http://localhost:4444/wd/hub', specs: ['todo-spec.js'] };

什么是webdriver.Capabilities.firefox()的IE版本?

我有一个脚本,适用于: … webdriver.Capabilities.phantomjs(); webdriver.Capabilities.chrome(); webdriver.Capabilities.firefox(); webdriver.Capabilities.safari(); … 但我尝试过的Internet Explorer任何级联失败。 什么是正确的语法?

节点Selenium WebdriverJS – 如何检查元素是否真正可点击?

如何检查一个元素是否真的在seleniumwebdriverJS点击? 我知道我可以检查元素是否显示,是否启用元素。 但是,如果该元素被其他元素隐藏,例如通过模式popup,则不能被点击。 在这种情况下,我希望webdriver等待,直到元素是真正可点击的。 这个怎么做? 谢谢您的帮助

Webdriver(wd)testing在本地工作,但超时Travis CI?

我有一些testing用gulp-mocha-selenium写在引擎盖下使用wd。 注意这是“wd”驱动程序而不是vanilla Webdriver可能很重要。 testing在这里: https : //github.com/UWFosterIT/react-starter/blob/master/test/acceptance/hello-spec.js 我的travis.yml是: language: node_js node_js: – "0.10.37" before_install: – "export DISPLAY=:99.0" – "sh -e /etc/init.d/xvfb start" – "npm install -g eslint gulp eslint-plugin-react webpack" before_script: – "sleep 30" script: – "gulp check" – "gulp test:server" – "gulp test:acceptance" addons: firefox: "31" testing在当地正常工作,但在TravisCI.org上超时。 我不知道从哪里开始寻找。 特拉维斯的结果: https : //travis-ci.org/UWFosterIT/react-starter/builds/55222925

如何在NodeJS WebDriver中切换窗口?

当没有getWindowHandles()函数时,如何获得在WebDriverJS中打开的新窗口的窗口句柄? 我需要切换到一个新的窗口来loginFacebook进行testing。

在量angular器中为e2etesting设置https代理

我想在使用Protractor的e2etesting期间将networking请求存储到第三方服务,同时保持浏览器和我的api之间的通信。 此外,我想能够保留一些特定的电话给我的API,同时保持其他电话不变。 我正在testing的应用程序被集成到Docker容器中。 e2etesting在Firefox中运行在一个容器中,而API服务器在另一个容器中运行。 所以我想要做的是build立一个代理节点服务器的容器(让我们调用这个容器proxy )。 我希望来自浏览器的所有networkingstream量都能通过代理服务器,其中一部分stream量可以根据需要进行存储。 这几乎工作。 但是,我观察到只有httpstream量通过代理传递,而httpsstream量转义代理。 我不知道为什么这可能会发生。 这里是量angular器configuration的相关部分: exports.config = { … capabilities: { 'browserName': 'firefox', 'proxy': { 'proxyType': 'manual', 'httpProxy': 'proxy:3000', 'sslProxy': 'proxy:3000' } }, … } 我尝试了sslProxy和httpsProxy选项,就像我在各种在线讨论中看到的一样,但是没有人帮助通过我的代理直接https请求。 例如,我在页面上添加了两个图片 – 一个是通过http提供的Google徽标,另一个是通过https提供的。 我可以在proxy泊坞窗日志中看到,通过http提供的图像请求通过代理服务器传递,但通过https提供的图像请求不通过。 所以我的问题是,我有什么明显的错误吗? 你能否build议是否可以通过代理服务器来指导浏览器的https请求?

从Node-webkit运行量angular器

除了使用CLI之外,是否可以以任何其他方式运行量angular器? 有一个API调用将模拟命令:“ protractor config file.js ”? 我想通过node-webkit应用程序开始testing,即使我可以通过directConnect参数直接连接到ChromeDriver,如果我无法在脚本中运行量angular器,这是没有用的。 当然,这是在Node和Protractor不能从CLI访问的环境中…模拟一个分布式环境,用户除了我的node-webkit之外不需要安装额外的应用程序(因此node-webkit用法) 。 提前感谢您的任何指针!

Firefox不会等待页面加载Webdriverio

我正在尝试使用Selenium运行我的testing,并刚刚遇到问题。 我有我为Chrome浏览器编写的testing。 现在我一直试图在Firefox浏览器中运行相同的testing,但是失败了。 我已经开始调查这个问题,并发现Firefox不会等到页面完全加载。 Chrome的作品完美。 我在Docker容器中运行Selenium 。 这是我的脚本 storeSearch(info) { let that = this; return new Promise(function (resolve, reject) { browserClient.init() .url("http://somewhere.com") .selectByVisibleText("#store","Tech") // Redirect to a new page .setValue("input[name='search']", info.searchCriteria) .selectByValue(".featured", 'MacBook') .click("button[name='info']") .element('.popup') .then(function (element) { if (element.state === 'success') { } }); }); } 它甚至不会尝试从select .selectByVisibleText("#store","Tech")select一个存储types,而只是抛出一个exception。 “一个元素不能使用给定的search参数(\”input [name ='search'] \“)。”, 我试图添加timeouts但它不工作,给我一个错误。 browserClient.init() […]

来自Javascript API的Selenium WebDriverJS

挣扎了一下,以便同时了解WebDriverJS和promise …并且大部分示例代码都是针对Python / Java,而不是Javascript。 所有我想要做的是获得一个页面的完整的HTML。 所以,如果你看看WebDriverJS的相同的代码: var webdriver = require('selenium-webdriver'); … driver.get('http://www.google.com'); driver.findElement(webdriver.By.name('q')).sendKeys('webdriver'); driver.findElement(webdriver.By.name('btnG')).click(); driver.wait(function() { return driver.getTitle().then(function(title) { return title === 'webdriver – Google Search'; }); }, 1000); 我试图简单地返回整个HTML文档,而不是只有标题。 在Python中,将是driver.page_source。 我从例子中学到了很多东西 ,所以我在这里有点失意。

了解Web驱动程序API

如果我在WebDriver API上理解了W3C的信息,那么实现这个API的浏览器就可以通过使用RESTful API来实现自动化。 也就是说,我可以打开HTTP连接到浏览器,并使用REST向其发送命令。 我也发现这个Gist确认我的猜测是正确的:Node.js脚本直接连接到一个已经作为WebDriver服务器启动的PhantomJS。 到现在为止还挺好。 我现在不明白为什么显然,对于任何其他浏览器,我仍然需要一个selenium​​服务器。 即使像webdriverjs这样的项目也要求我运行一个Selenium服务器。 我的问题是:为什么? 不应该有一个额外的Selenium服务器自动化浏览器? 如果浏览器不能直接提供这个API(就像PhantomJS显然那样)? 任何人都可以点亮一下吗?