protractor

How to click a button in row in a table using protractor js

你离开我真会死。 提交于 2019-12-23 05:23:29
问题 I am writing protractor test cases. I want to click on edit button. When I am checking by id it is not found. Code: <table class="table table-bordered table-hover"> <thead> <tr> <th>Code</th> <th>Start Date</th> <th></th> </tr> </thead> <tbody> <tr ng-repeat="batch in batches.list"> <td><a ui-sref="root.courses.detail.batches.assessments({ batch_id: batch.id,assessment_status: 'published'})">BID00{{batch.id}}</a></td> <td>{{batch.start_date}}</td> <td> <button id="edit" type="button" class=

Element.getText() in Protractor [duplicate]

强颜欢笑 提交于 2019-12-23 05:07:57
问题 This question already has answers here : Protractor: element.getText() returns an object and not String (3 answers) Closed 2 years ago . I want to write a test case in which I compare the value of an element clicked in previous page to that of an element's value in the current page. I am using the following code - validateText = SoftwaresUnmappedPage_POM.checkFirstSoftwareName.getText(); expect(validateText+"*").toBe(SoftwareSummary_POM.softwareName.getText()); For example - If I click on a

How to upload file if element is <label> tagname?

霸气de小男生 提交于 2019-12-23 05:06:20
问题 Here is HTML code: <px-upload-zone class="dz-clickable" _ngcontent-c34="" _nghost-c35=""> <div class="upload-container" _ngcontent-c35=""> <!----> <div class="dialog-wrapper dz-default dz-message" _ngcontent-c34=""> <span _ngcontent-c34="">Drag & Drop</span> <span class="browse-label" _ngcontent-c34=""> <span _ngcontent-c34="">or</span> <label class="link-label" _ngcontent-c34="">browse</label> </span> </div> <div class="upload-summary" _ngcontent-c35=""> <div class="dropzone-previews"

“setNetworkConditions” in protractor e2e tests says not a function

僤鯓⒐⒋嵵緔 提交于 2019-12-23 04:58:19
问题 I am trying to use the driver.setNetworkConditions({ offline : true }); in my code, but it says that Failed: _protractor.browser.driver.setNetworkConditions is not a function . Here is my code to access it. import { browser } from 'protractor'; describe('disable browser network', () => { "use strict"; let browserA = browsers.a; it('should disable chrome network', () => { browserA.ignoreSynchronization = true; browser.driver.setNetworkConditions({ offline: true }); //..... my other

Cannot install Protractor 2.0.0 : ENOENT in bufferutil while node-gyp rebuild

天涯浪子 提交于 2019-12-23 04:31:34
问题 Trying to install Protractor 2.0.0, I'm facing the following problem: $ npm install -g protractor npm http GET https://registry.npmjs.org/protractor npm http 304 https://registry.npmjs.org/protractor ... npm http 200 https://registry.npmjs.org/nan > utf-8-validate@1.0.1 install C:\Users\clouderial\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate > node-gyp rebuild C:\Users\clouderial\AppData\Roaming\npm\node_modules

browser.helperApps.neverAsk.saveToDisk preference isn't working with protractor for firefox

帅比萌擦擦* 提交于 2019-12-23 04:19:12
问题 I am using firefox-profile with below settings - var q = require('q'); var FirefoxProfile = require('firefox-profile'); var firefoxProfile = new FirefoxProfile(); firefoxProfile.setPreference("browser.download.folderList", 2); firefoxProfile.setPreference("browser.download.dir", process.cwd() +'/e2e/downloads/'); firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/x-executable"); MIME-type of file is "application/x-executable". After adding all above details,

Viewing outstanding requests

自闭症网瘾萝莉.ら 提交于 2019-12-23 04:18:17
问题 Is there any way to view what requests Protractor are waiting on? I'm trying to debug flaky state testing, but it is hard to tell whether a button didn't trigger a response or if Protractor didn't bother to wait. TL;DR: How can I view the remaining promises on the Protractor control flow? 回答1: The usual approach is to start protractor in a debug mode and put browser.debugger() breakpoint before the problem block of code. See more information at Debugging Protractor Tests. On the other hand,

How to check checkbox in repeater with protractor

僤鯓⒐⒋嵵緔 提交于 2019-12-23 04:03:53
问题 I am having difficulty checking a checkbox in an AngularJs repeater with protractor. The model looks like this: environments: [ { name: 'Proof of Concept', checked: false }, { name: 'Non-Production', checked: false }, { name: 'Production', checked: false } ] The view like this: <div class="checkbox" ng-repeat="environment in vm.assessment.environments"> <label><input type="checkbox" ng-model="vm.assessment.environments[$index].checked" ng-click="vm.checkboxChanged()" ng-required="!vm

Protractor failed to start test with firefox

跟風遠走 提交于 2019-12-23 04:02:15
问题 I can not start the test with protractor on firefox version 56.0.1. my protractor version is 5.1.2 exports.config = { allScriptsTimeout: 11000, specs: [ './e2e/**/*.e2e-spec.ts' ], capabilities: { 'browserName': 'firefox' }, directConnect: true, baseUrl: 'http://localhost:4444/', framework: 'jasmine', jasmineNodeOpts: { showColors: true, defaultTimeoutInterval: 30000, print: function() {} }, }; this is the error: [00:02:20] I/launcher - Running 1 instances of WebDriver [00:02:20] I/direct -

protractor + cucumber - element not visible even though element is visible

为君一笑 提交于 2019-12-23 03:52:12
问题 this.When(/^the user clicks on login button$/, function () { return browser.wait(wagLoginPage.loginPage.signIn.isPresent().then(function (visible) { if(visible){ console.log("element is visible !!!!!!!"); wagLoginPage.loginPage.signIn.click().then(function(){ expect(visible).to.be.true; }); } else{ expect(visible).to.be.true; } }, function () { chai.assert.isFalse(true, "SingIn is not visible!") })); }); My test randomly fails in the above step. For the above code, in console window