protractor

Error while downloading geckodriver during webdriver-manager update from jenkins

和自甴很熟 提交于 2020-01-16 11:42:49
问题 I am trying to run webdriver update from jenkins. I am downloading geckoDriver and chromeDriver. Chrome driver is downloading and unzipping properly. But gecko driver download is not working. However this is working fine from local. Issue occurs only in jenkins Command used: node_modules/protractor/bin/webdriver-manager update --ignore_ssl --proxy=http://proxy --versions.gecko=v0.25.0 --versions.chrome=78.0.3904.105 Firefox version in server: 60.9.0 Error: [16:23:13] I/http_utils - ignoring

Error while downloading geckodriver during webdriver-manager update from jenkins

Deadly 提交于 2020-01-16 11:42:27
问题 I am trying to run webdriver update from jenkins. I am downloading geckoDriver and chromeDriver. Chrome driver is downloading and unzipping properly. But gecko driver download is not working. However this is working fine from local. Issue occurs only in jenkins Command used: node_modules/protractor/bin/webdriver-manager update --ignore_ssl --proxy=http://proxy --versions.gecko=v0.25.0 --versions.chrome=78.0.3904.105 Firefox version in server: 60.9.0 Error: [16:23:13] I/http_utils - ignoring

Protractor get element by model in repeater array

假如想象 提交于 2020-01-16 05:20:32
问题 For example, in HTML page: <tr ng-repeat="post in posts"> <td ng-click="activePost(post)" class="title">{{post.title}}</td> <td><button class="btn btn-danger" ng-click="delete(post)">Delete</button></td> <td><input type="checkbox" ng-model="post.active" id="{{post.id}}" /></td> </tr> Then, I want something like: element.all(by.repeater('post in posts')).then(function(posts) { var activePost = posts[0].element(by.model('active')); expect(activePost).toEqual(true); }); This returns an unable to

Protractor TRY/Catch issues

若如初见. 提交于 2020-01-16 03:56:18
问题 I was using Protractor and Cucumber and noticed that there were instances where I wanted to capture a NoSuchElementError: No element found using locator: By.cssSelector("someCssLocatorHere") . However, using the traditional try/catch block wouldn't work unless I called both the callback and errBack of the .then() function and throw the error so that I can catch it later like following: try{ somePromise.then(function(){ //callback function if promise gets resolved successfully }, function(e){

I can't create filter to extract all elements that i need

喜欢而已 提交于 2020-01-15 14:22:27
问题 I get prices, even that I don't need, how can I filter them? <div class="ssl-price-box"> <price value="377" units="/yr" class="lg-price ng-isolate-scope"><span class="price"><span class="currency-icon">$</span><span class="integer ng-binding">3.</span><span class="cent ng-binding">77</span><span class="units">/yr</span></span></price> <!-- ngIf: product.prices.max.certIsPromo --> </div> <price value="13888" units="/yr" class="lg-price ng-isolate-scope"> <span class="price"> <span class=

InvalidSelectorError: invalid selector: Unable to locate an element with the xpath expression

狂风中的少年 提交于 2020-01-15 10:22:50
问题 Following is html snippet element <a ng-click="nodes.setViewType('tiles',true)"> <span class="fa fa-check Tick-Inactive" ng-class="nodes.viewType == 'tiles'? 'Tick-Active':'Tick-Inactive'" style=""></span> Tile View </a> Trying to use ng-click or ng-class in locators using java script escape characters. But it showing invalid or illegal selector was specified element(by.xpath("//a[contains(@ng-click,'nodes.setViewType(\'tiles\',true)')]")); element(by.css("span[ng-class^=nodes.viewType == \

Multiple terminal window in Jenkins?

三世轮回 提交于 2020-01-15 10:15:49
问题 Recenlty I have started with some Jenkins tutorials to learn about this tool. As an excersise I would like to start my Angular project and run some protractor e2e tests on it. Normally I would open terminal window, type : npm install, npm start and run protractor tests. I have one issue though to execute this on Jenkins. Command 'npm start' will run my angular application on localhost:4200. That require some time and after that this terminal window is "frozen" there is information that my

How to setup Selenium grid remotely in protractor

て烟熏妆下的殇ゞ 提交于 2020-01-15 09:39:07
问题 I have my conf.js file which runs fine locally. But now as per my requirement I need to run it in a bamboo task. Since my code is going to run on server there is a remote selenium webdriver that i need to add to the conf.js. Can you please help me out how it is done? My conf.js looks like this : exports.config = { params: { url: "URL", testroadname:"Testing123", sleeptime:1000 }, directConnect: true, // Capabilities to be passed to the webdriver instance. capabilities: { 'browserName':

How can I check if an element is require using Protractor in angular2?

守給你的承諾、 提交于 2020-01-15 08:55:23
问题 How can I check if an element(input field or drop down list) is require using Protractor in angular 2? expect(helpers.hasClass(element(by.id('datasourceName')), 'ng-invalid')).toBe(true); i'm using helper from below: https://www.npmjs.com/package/protractor-helpers no idea whether it's correct way or not. 回答1: locate the input and check with the getAttribute method: expect(inputElement.getAttribute("required")).toBe("true"); 来源: https://stackoverflow.com/questions/41401433/how-can-i-check-if

How to break out of for loop in protractor?

三世轮回 提交于 2020-01-15 07:36:27
问题 This is my code - formElements[0].findElements(by.repeater(repeater)).then(function(items){ console.log(i, '>>>>>>>>>.No of items in the list --- '+items.length); (function(items){ for(var x1=0; x1<itemsToBeSelected.length; x1++){ console.log(i, '>>>>>>.Looking for item --- '+itemsToBeSelected[x1]); skip = false; (function(items, x1){ for(var x2=0; x2<items.length; x2++){ (function(items, x2){ items[x2].getText().then(function(itemName){ console.log(i, '>>>>..Verifying '+itemsToBeSelected[x1]