FAQ Database Discussion Community


How to share a test across multiple specs in Protractor

javascript,angularjs,protractor,angularjs-e2e,e2e-testing
I'm using Protractor to test an Angular app. There is a generic share functionality which runs across various different pages - at the moment I have the test in each individual spec for each page, however now looking into optimisation, I would quite like to make this as DRY as...

Difference running Protractor with/without Selenium?

google-chrome,firefox,selenium,selenium-webdriver,protractor
Checking the protractor documentation, I see there is a option to run protractor without using Selenium server using directConnect: true flag. What is the difference between running protractor tests with a selenium server and without a selenium server other than the fact that only Chrome, Firefox are supported for the...

Protractor, login to asp,net MVC login page, wait for default page then , redirect to angular page and do tests…how?

c#,angularjs,asp.net-mvc-4,selenium,protractor
I'm trying to implement Protractor test on my MVC Project that we are slowly converting to Angular I login on a MVC login page, enter the login and password, Click login, then I need to wait for the login to go through several pages, and get to the default screen....

Protractor: cleanup after test suite is finished

javascript,selenium,testing,protractor,end-to-end
In my "conf.js" test suites are arranged as follows(using saucelab's webdriver): suites: { abc: './abc/spec.js', xyz: './xyz/spec.js', pqr: './pqr/spec.js' }, The problem with above arrangement is if one of the alert box/window unexpectedly appears in one of the test suite,test suites after that particular suite suffer and start failing. Is...

Jasmine2 Stacktrace

jasmine,protractor,stack-trace,jasmine2.0
When we run our Protractor tests with the jasmine2 framework we get rather useless stack traces such as the following. These are sporadic and never in the same place twice. I can re-run the tests and it'll work just fine. What exact causes this type of error and how can...

AngularJS & Protractor - getLocationAbsUrl() doesn't return the url (string) but an object

angularjs,protractor
The title is saying it all. I want to log the url to a console but it gives me some object spec.js describe('Protractor Demo App', function() { it('should add 1 and 2', function() { browser.get('http://juliemr.github.io/protractor-demo/#/'); element(by.model('first')).sendKeys(1); element(by.model('second')).sendKeys(2); element(by.id('gobutton')).click(); console.log(browser.getLocationAbsUrl()); // logs some object expect(browser.getLocationAbsUrl()) .toEqual('/'); }); }); And this is...

Protractor: Return Repeater Count from Prototype

javascript,angularjs,count,repeater,protractor
I have this behavior which I can't understand: Cart.prototype.getCouponsCount = function() { // Loop through all rows of coupons currently available in the cart ele.cartCouponsList.count().then(function(count) { console.log("Amount of items in cart:", count); return count; }); }; When called like this: var Cart = require("../../../../lib/cartlib"); var cart = new Cart(); expect(cart.getCouponsCount()).toBe(2);...

Jasmine 2 custom matcher for hasClass in Protactor

jasmine,protractor,karma-jasmine
I upgrade my Jasmine 1.3 to 2.0 so I added a custom matcher to check css is present.Below is the code to check the matcher hasClass = function(actual,expected){ return actual.getAttribute('class').then(function (classes) { return classes.split(' ').indexOf(expected) !== -1; }); } But when I upgrade to Jasmine 2 then promise throws error...

Ignore synchronization for $http, but not $timeout

javascript,angularjs,selenium,testing,protractor
Is there a way to ignore synching with the http request for a angular app? I have this form that should be disabled during the POST of the form. When this POST request is pending, the form should be disabled and this is what I would like to write specs...

Sync Protractor with an Angular app hosted inside an iframe by a non-Angular website

javascript,angularjs,protractor
I'm having trouble accessing elements via methods such as by.binding(). The project setup is as follows: Non-angular website | --> Iframe | --> Angular app Here's a snippet of what I'm trying to do: // Disable sync browser.ignoreSynchronization = true; // Navigate to non-angular website browser.driver.get('http://non-angular.com'); // Switch to angular...

Select element protractor

angularjs,protractor
Im having big problems trying to write my end2end testing. This is my scenario: I want to count the number of options for a given element. What I DONT want to do is to use id's, so Im trying to select it without polluting the html. Lets see the html:...

Load additional CONFIG file with values

javascript,selenium,testing,protractor,end-to-end
I am using lot's of values for my test like username and password. For this purpose I created a config file where I store just this data in JSON, it looks like: { "login": "test", "password": "pass", "number": "1234", } It works for me if I request it at start...

Retrieve element within repeater in Protractor

angularjs,jasmine,protractor,angularjs-e2e,e2e-testing
I'm sure this is a simple one but my eyes are slowly dying on me. Basically, is there a way to get an element within a repeater? For example, I have a bunch of anchors within a repeater, however the class attached to the anchor is generic, so something like:...

Browser.wait() until .getAttribute() returns true

javascript,angularjs,selenium,testing,protractor
I'm still learning Protractor so I'm not sure if this is a simple answer that I'm not getting but I'm just trying to have the browser wait until the attribute I'm retrieving is true. I'm testing the pizza option for this site. Complete code: browser.get('https://material.angularjs.org/latest/#/demo/material.components.select'); var topping = element(by.model('topping')); topping.click();...

How to get the value from selectbox?

javascript,selenium,testing,protractor,end-to-end
I am trying to verify that correct option is selected from selectbox using protractor. This is how I pick value from selectbox: element(by.id('form-mileage-unit')).click().then(function() { element(by.cssContainingText('option', browser.params.lengthUnit)).click(); });; So base on this I write code below: it('Verify paint color', function() { element(by.id('form-mileage-unit')).click().then(function() { element(by.cssContainingText('option', browser.params.lengthUnit).getAttribute("value")).toEqual(browser.params.lengthUnit); });; });...

get value/innerHTML/text of item produced with css locator

jasmine,protractor
I have something like: var items=$$('some css location'); console.log(items.count()); console.log(items.get(3).getInnerHTML()); console.log(items.get(3).getAttribute('text')); console.log(items.get(3).getText()); but all console.log calls return the objects itself with their functions,fields.. Is there a way to get the innerHTML/texts/values of the items without using expect? If I want to iterate the items and do some parsing over their...

Protractor testing, access and modify Window object properties

javascript,angularjs,protractor,jwt,satellizer
I'm trying to write a simple e2e test for the authentication we use in our project, Authentication is based on a json web token which is set into window.localStorage.satellizer_token . To set it i use the code below, but for what i see it doesn't really set the real localStorage...

Is it possible to run an incognito with normal Chrome browser instance with Protractor?

google-chrome,protractor,selenium-chromedriver
I need to run test in two browsers with the same view but logged with different users. As the server is changing the cookie and logging out the first user because of the shared cookie between multiple windows in Chrome I cannot run the test. So, I wonder if it...

A Jasmine spec timed out. Resetting the WebDriver Control Flow - when redirect to new page

javascript,angularjs,protractor,angularjs-e2e,e2e-testing
I'm bedinner in e2e testing and have a problem. When I do login - I make redirect from login.php to index.php page. But my test is fails with following errors: ..A Jasmine spec timed out. Resetting the WebDriver Control Flow. F Failures: 1) Login Page should login and redirect to...

protractor: how can you check if element exists immediately

protractor
I have a page that has a drop down with a list of clients. Because there are a lot of clients (e.g. 500) it takes about 20seconds to load all of it. I want to test this loading and check if a certain client is present at a certain time....

Determine if ElementFinder or ElementArrayFinder?

javascript,selenium-webdriver,protractor
Is there an official way to determine if the input I'm receiving from a function is an ElementFinder (a single web element) or an ElementArrayFinder (a collection of web elements). So far I've got this. if (_.isFunction(elemOrElems.count)) { // it's an ElementArrayFinder } This seems like it's depending on an...

Angular/Jasmine: $httpBackend.expectGET works on Mac, not on Linux

linux,angularjs,jenkins,jasmine,protractor
I have the following setup to test a directive: beforeEach(inject(function($compile, $rootScope, $injector) { $httpBackend = $injector.get('$httpBackend'); var html = '<password-strength-bar password-to-check="password"></password-strength-bar>'; scope = $rootScope.$new(); elm = angular.element(html); $compile(elm)(scope); $httpBackend.expectGET('l10n/en.js').respond({}); $httpBackend.expectGET('tpl/page_signin.html').respond({}); })); This works fine on a Mac. However, when I run the same code on Linux, it fails with the...

Click on a element with same class that matches text and exit in Protractor

javascript,testing,selenium,protractor,end-to-end
I am able to find the text by using element.all(by.repeater()) in protractor and using each to check for matching text. Now the problem is exiting once the match is done and clicking on the matched element. I tried using .each(), but unable to exit iteration. Any Suggestions?...

How to run particular protractor test case from command prompt

protractor
I am successfully able to run the protractor scripts. Below is the protractor.config.js file which I am using to run the protractor scripts. var Jasmine2Reporter = require('protractor-jasmine2-screenshot-reporter'); var HtmlReporter = require('protractor-html-screenshot-reporter'); var jReporter=new Jasmine2Reporter({ dest: './protractor-result', fileName: 'protractor-demo-tests-report.html' }); var reporter=new HtmlReporter({ baseDirectory: './protractor-result', // a location to store screen...

Protractor, Done and Expect, why do we need wait?

selenium,selenium-webdriver,jasmine,protractor
I thought Done would make things run synchronously, meaning after I click a link, the click call back would happen after the click, apparently not as this doesn't work. browser.ignoreSynchronization = true; var firstURL = "https://www.google.com/?gws_rd=ssl"; describe("test", function () { browser.get("http://www.google.com"); it("Should be on google url", function () { expect(browser.getCurrentUrl()).toBe(firstURL);...

Protractor - select element in repeater after $http call

ajax,angularjs,selenium,sails.js,protractor
I'm starting out on protractor testing of my sails.js / AngularJS app. Simplified, I have a following kind of ng-repeat in my HTML: <div ng-repeat="book in books"> book.name </div> My test clicks a button that sends a $http POST call to the server, creating another book, and upon success, adds...

How to solve error about “invalid selector” when using “if statement” in Protractor JS?

javascript,angularjs,node.js,jasmine,protractor
I want to use an invisible element as a condition if it present do X and else do Y. I've already tried to use by the class of this element as the locator and the ng-model and binding of him but none of them is worked :/ Please your assistance...

How to find and click a table element by text using Protractor?

javascript,angularjs,selenium,protractor,end-to-end
<tr id="item" ng-repeat="item in itemList> <td id="code" ng-repeat="column in columns">Some Text</td> </tr> I've seen some other similar questions but I couldn't solve it yet. Thats what I've tried so far: element.all(by.repeater('column in columns')).findElement(by.id('code')).getText('Some Text').click(); EDIT: <tr ng-repeat="item in items> <td>{{item.name}}</td> <td>{{item.description}}</td> </tr> Which results in: <tr> <td>Some Name</td> <td>Some...

Protractor scrolling through executeScript not working

javascript,angularjs,google-chrome,protractor,end-to-end
I am testing my Ionic app. In one page, the button to be clicked is out of the bounds of the window. Hence the following code: element.all(by.css('.item.item-complex')).get(9).click(); throws the error: ElementNotVisibleError: element not visible Hence, I am trying to scroll down the page to make the button visible in page...

Is it possible to resolve promise within the 'executeScript'?

javascript,selenium-webdriver,jasmine,protractor,webdriverjs
I am trying to write my first test using Protractor+Jasmine for my non Angular application. I need call API function of my app global instance, get result and compare it in test. One of passed in parameters for this function is a callback which is called as soon as data...

How to close a native web browser popup in Jasmine JS?

node.js,google-chrome,selenium,jasmine,protractor
How to close a native web browser popup in Jasmine JS? I can't succeed to close this dialog and it keep showing up in all the running. Please your help! The code: describe('LiveSite Portal - Client perform a call', function() { it('LiveSite - Home Page', function() { liveSiteHome(); }); it('LiveSite...

Clear console log in browser using protractor

protractor
I'm able to retrieve the browser logs using browser.manage().logs().get('browser').then(function(browserLog) { logger.info('log: ' + require('util').inspect(browserLog)); }); referenced from https://github.com/angular/protractor/blob/master/docs/faq.md Similarly is there a way to clear the browser console logs?...

Why does Protractor sometimes returns a promise and sometimes returns a value?

javascript,angularjs,protractor
In the official documentation you can find the following code: var history = element.all(by.repeater('result in memory')); expect(history.count()).toEqual(2); But you can also find examples using promises element.all(by.repeater('app in userApps')).count().then(function(count) { console.log(count); }); So why does Protractor sometimes returns a promise and sometimes it returns a value?...

Halt javascript execution until promise is resolved

javascript,angularjs,node.js,jasmine,protractor
I have a specific use case where in test code I want to fetch a tables headers (async) and then dynamically create getters on a javascript object. The syntax that I would like to use in my test is antenneTable.row(0).getAzimut();. The problem I am having is that antenneTable.row(0); returns a...

Wait for UI text to be updated

javascript,angularjs,protractor
As part of our application a user can click on an item in a list, this then changes a load of data on the screen, included the text on a filter button. for example a list may be cities London New York Tokyo clicking on London will change the filter...

cucumber-js and Chai how to expect if element with given selector exist in DOM

javascript,protractor,chai,cucumberjs
I have a problem with cucumberjs. I cannot find a way to ensure that element with given selector is presented into DOM. I'm using cucumberjs with Chai. https://github.com/cucumber/cucumber-js isPresent returns object - no matter if the element exists or not. So the question is how to check if element is...

Protractor: How to test window.print()

javascript,selenium,selenium-webdriver,protractor
I'm trying to test print functionality of a button, like: it('print document', function(){ element(by.id('print-button')).click(); expect(window.print()); }); I want to test browser print dialog box. How to do this?...

How can I call external JS from another JS by Protractor JS?

javascript,node.js,selenium-webdriver,jasmine,protractor
I'm using Jasmine as my JS framework to my automated test scripts. I want to call another JS file from another test script. Something like: describe('call JS Testing', function() { var exScripts = function(script){ exScripts.src = 'c:\\automation\\tests\\'; }; it('call to script', function() { exScripts('onboarding.js'); }); }); Is it possible to...

How to call browser.get only once in a script?

javascript,angularjs,automation,jasmine,protractor
I am new to protractor, right now I am putting browser.get(URL) within the first 'it' statement and then for my afterEach statement I make the browser go back to the homepage. I am wondering if there's a better place to put the browser.get statement to make my tests more module?...

How do I return the text of an alert in Protractor?

angularjs,webdriver,protractor
I have a test that fills out a create customer page. Upon clicking save, an alert pops up with the newly generate guid of the customer. I'm trying to make a function that clicks save, captures the alert text, and then returns it to my protractor test to use later....

Error using Protractor 2.1.0 with CucumberJS

angularjs,cucumber,protractor,cucumberjs
I'm experiencing trouble upgrading to Protractor 2.1 from Protractor 2.0, and suspect it's an issue with the use of Protractor 2.1 and CucumberJS. When I edit the package.json to downgrade to Protractor 2.0.0, and reinstall the node packages, the issue is resolved. What's causing the error in Protractor 2.1.0? How...

Get attribute from table - Protractor

javascript,testing,protractor,end-to-end
Hey guys I have a table with multiple TR row, i need to be able to click on or any child <td> where VALUE is 91, In this example below there are just 2 values, but in a futurue there can be a 20 of them, and they can be...

how do you start webdriver-manager start in the Config file

angularjs,testing,selenium,protractor
I'm trying to get my config file to the point where I don't have to go to the mac terminal and type webdriver-manager start. Is it possible to have the config file do that? I have listed my code below to give you idea what I have set up. I...

Protractor custom locator fails to locate the element

javascript,angularjs,selenium,protractor,end-to-end
I have added a custom data attribute to the elements i need to identify and interact using protractor. The attribute is data-test-id. I created a custom locator in the onPrepare callback in conf.js to detect the element. It is below: onPrepare: function () { by.addLocator('testId', function(value, parentElement) { parentElement =...

chai.assert() wont run methods in a test before the assertion (chai assert lib with protractor)

protractor,assert,chai,e2e-testing
First time I post an issue on SO, I hope I'm doing it right. it (' :: 2.0 service creation :: should fill out service info tab', function(){ createNewService.setServiceName(e2eConfig.newServiceDetails.basicServiceName); createNewService.selectCategory(); createNewService.setIntroText(e2eConfig.newServiceDetails.introText); createNewService.selectParent(); createNewService.uploadIcon(); createNewService.nextTab(); //right now assert will fire off without running the methods above because //we are still on...

How to make parts of Protractor wait or become synchronous?

javascript,selenium,jasmine,protractor,mocha
I have code like this in a protractor test, it goes to a home page determines we need to login and then calls this function. Note I'm running this in a NODE.js environment: function Login() { browser.findElement(by.id('ID')).then(function (ele) { ele.sendKeys('SomeUserName'); browser.findElement(by.id('password')).then(function (ele) { ele.sendKeys('SomePassword'); browser.findElement(by.partialButtonText('Sign in')).then(function (ele) { ele.click(); browser.getCurrentUrl().then(function...

How to identify this element in protractor?

javascript,testing,selenium,protractor,end-to-end
When I view some customer information, I see the customer information displayed at the bottom. I believe it comes from JSON call. How to identify this element? I tried className but not working. Thanks for your help. And tried this css as well. .override-info hide-mobile ng-scope. I need to assert...

E2E Protractor tests in firefox says 8 pending specs what does it mean?

javascript,selenium,jasmine,protractor,end-to-end
When I run my tests I get: 11 specs, 0 failures, 8 pending specs Finished in 56.861 seconds [launcher] 0 instance(s) of WebDriver still running [launcher] firefox #1 passed. What does this "8 pending specs" mean?...

Protractor e2e tests with MEANJS navigation

angularjs,protractor,meanjs
I'm still in learning mode with most of this. I have installed MeanJS and am using the navigation that came out of the box. I am starting to implement end-to-end tests using Protractor and Jasmine. I want my protractor tests to interact with the navigation component. In full page it...

Suites vs Specs Protractor

angularjs,testing,protractor,end-to-end,test-suite
I have recently picked up a project using Protractor. I am having troubles understand the difference between a suite and a specs. I am also having trouble with a suites when I am running a folder of test's after that folder is ran I run another folder of test and...

What does Protractor browser.wait return if the condition never becomes true?

promise,protractor,wait
I want to use the browser.wait function to repeatedly check if a button element is present for a certain amount of time then use the relevant callback. Below I have the code that doesn't use the wait. detailsButton.isPresent() .then(function(present){ if(!present) { callback(); } else { callback(new Error('The details button was...

Issue with select tag in IE with Protractor

angularjs,internet-explorer,selenium,webdriver,protractor
I have protractor tests running with Selenium using the IEDriverServer (32 bit). I am having a few issues with <select> tags not being clicked and revealing their options. Here is my conf.js: exports.config = { // The address of a running selenium server. seleniumAddress: 'http://localhost:4444/wd/hub', // Capabilities to be passed...

Protractor - Where to use browser.waitForAngular()

javascript,angularjs,testing,protractor,angularjs-e2e
I have some tests written using protractor for angular.js app. I am using Page Objects design pattern and there i have some methods that navigate to other pages by clicking on links and buttons. and soon after that i am calling browser.waitForAngular(). Page Object module.exports = function () { this.companyNameLink...

Expect fails for verifying inner HTML

jquery,selenium,testing,jasmine,protractor
For some reason my assert in protractor fails, what i'm trying to do is get the innerHTML (text) from an element: var stuff = $('css').html(); expect(stuff).toBe("Inner HTML Text here"); I verified that the $().html() yields the text i desire on the console, what is wrong with my expect statement? TypeError:...

Upload file - Protractor

javascript,selenium,testing,protractor,end-to-end
I fight with protractor because for some tests I need to UPLOAD file. My HTML looks like: <div class="panel-footer"> <ul class="list-unstyled"> <!-- ngRepeat: file in imagesToUpload --> </ul> <button class="btn btn-sm btn-success pull-right ng-binding ng-hide" ng-show="imagesToUpload.length" ng-click="uploadImages()">Nahrát na server</button> <button class="btn btn-sm btn-primary ng-binding" ng-file-select="onImageSelect($files)" data-multiple="true" style="overflow: hidden;">Vybrat soubory<input...

CKEditor + Protractor: Testing with Protractor can't find CKEditor instance

javascript,angularjs,selenium,ckeditor,protractor
I am using Protractor for a non-Angular page and wanting to find the CKEditor instance on the page to then set data for. I can do this in Chrome console via: CKEDITOR.instances.html_editor.setData("Hello") In my test for the page, I have the code below: it('should enter text in editor successfully', function()...

error while sending text to div field in Safari using protractor

selenium,selenium-webdriver,safari,protractor,end-to-end
I've got a text area div field: <div id="shortansweractivityId" class="shortanswerText ng-pristine ng-scope ng-isolate-scope ng-invalid ng-invalid-required ng-touched" ng-model="activity.answer" ng-if="isEditable" ng-focus="editing()" placeholder="Write here..." contenteditable="true" content-type="text"></div> I'm able to use sendKeys in chrome using: element(by.css('div#shortansweractivityId')).sendKeys('Test'); But when run the same in safari it errors out: UnknownError: undefined is not an object (evaluating 'b.value.length')...

How to use Jasmine and CucumberJS with Protractor

angularjs,testing,jasmine,cucumber,protractor
I'm looking to use Protractor, CucumberJS, and Jasmine for testing my project. How do I use both Jasmine and CucumberJS with Protractor? Here's the project setup I've created: /path/to/myproj/protractor.conf.js exports.config = { seleniumServerJar: 'node_modules/protractor/selenium/selenium-server-standalone-2.45.0.jar', specs: [ 'features/*.feature' ], baseUrl: 'http://localhost:8080', multiCapabilities: [ { 'browserName': 'chrome' } ], allScriptsTimeout: 380000, getPageTimeout:...

Should I use ids to locate elements?

angularjs,selenium,protractor,end-to-end,e2e-testing
Started with Angular and Protractor. It just feels wrong to write some heavy css selectors which will break instant when you change something. Using ID's would make testing way easier. I'm not using any id attribute for styling yet. Are there any drawbacks using ids for testing I haven't considered?...

protractor debug mode gives “FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory”

javascript,node.js,protractor,browser-automation
I'm running a script to automate a login to a Web page using NodeJS 0.12.4, Protractor 2.1.0., my system is a Win 8.1, i7 2.5 GHz, 16 GB RAM, so I think it's unlikely that I ran out of memory!. Just FYI, when I comment all the statements in the...

Getting the button text in Protractor

javascript,angularjs,protractor
I have created a custom locator to find an element with the ng-click method used. I have used it to get a reference to a button in my DOM. this.button = element(by.ngClick('login()')); i want to get the text that is on the button from the reference. For example if the...

How to implement IF statement in Protractorjs Spec.js file?

javascript,internet-explorer,selenium,selenium-webdriver,protractor
I am trying to run spec.js file for multiple browsers i.e., using Multicapabilities in conf.js. But I want one statement of code to be executed only for IE and I am trying to put that in IF statement by taking the title of the browser as the condition in IF....

MSSQL - Nodejs - Undefined is not a function issue

sql-server,node.js,protractor
I have been trying to connect to MSSQL database using node module in my protractor tests. I tried both the methods below but each time I am either getting undefined is not a function or getting cannot read property of "query/execute". Error: [launcher] Running 1 instances of WebDriver [launcher] Error:...

protractor finds element in --elementExplorer mode but not in normal mode

angularjs,protractor
I am getting a NoSuchElementError in my test. So I ran protractor in --elementExplorer mode to see if I could figure out how to resolve the required element. But in --elementExplorer mode the exact same locator finds the required element. The locator is: var e=browser.driver.findElement(by.css('#newProjectKickoffDate')) Any ideas?...

Protractor in Node: How do I order my tests to run synchronously?

node.js,selenium,jasmine,protractor
I'm wondering how to execute multiple "describe" blocks in synchronous order? describe('Go To Home Page', function () { browser.ignoreSynchronization = true; it("Url should be on Login Page", function () { browser.get(HomePageUrl).then(function () { browser.wait(urlChanged(loginPageUrl), 2000).then( function (newurl){ var url = browser.getCurrentUrl().then(function (url) { expect(url).tobe(loginPageUrl); //I know I'm at Login page...

Making driver not to quit between tests in protractor

protractor
there are two it() testcases in protractor it('it1',function(){ }); it('it2',function(){ }); does the driver in protractor quits after completing it1? Can we make protractor not to quit the driver? ...

Manage Protractor tests with a single Gulp task

angularjs,protractor
I'm trying to get e2e testing going with on my angular project using Gulp. I'm able to get it working, but only if I manually launch a standalone selenium server using webdriver-manager start in a seperate terminal window. Ideally I would like my gulp task to manage starting and stopping...

How do I make direct server calls and verify returned data in a Protractor test?

angularjs,node.js,jasmine,protractor
I have a Protractor test for my Angular application that signs up a new user, logs into the app and then deletes the account. My app doesn't currently have "delete account" functionality in its UI. However, it does have an API to delete users. I have the following test that...

Angular + Selenium: Cannot get value from input field

javascript,angularjs,selenium,selenium-webdriver,protractor
I have written my tests in Protractor and I've used an expect statement: loginPage.email.sendKeys( params.login.email ); expect(loginPage.email.getText()).toEqual( params.login.email ); However, my test is failing because signUpPage.email.getText() is returning an empty string. I couldn't find what function to call in Selenium's documentation for input field to return the correct value? In...

Element is not clickable at point - Protractor

javascript,testing,protractor,end-to-end
I'm getting an error that element I am trying to click on is not click able which I belieave is not true. My error looks: 1) Open VehiclePage and populate data Populate vehicle data Message: UnknownError: unknown error: Element is not clickable at point (1315, 371). Other element would receive...

Node.d.ts issues errors using typescript compiler, how do I fix?

node.js,visual-studio,typescript,jasmine,protractor
I have a project that's a NODE console application project using Visual Studio 2013. When I compile the solution I'm getting typescript errors as follows: Typescript wants a semicolon after export interface ReadableStream extends EventEmitter { readable: boolean; read(size?: number): string|Buffer; //Like this ----> read(size?: number): string;|Buffer; Which means I...

Waiting for Ionic Loading dialogs with Protractor

ionic-framework,protractor,ionic,angularjs-e2e,e2e-testing
There are similar questions (linked below) but none solves this problem. I'm writing Protractor tests for an Ionic Project. I need to execute tests at times when an Ionic Loading dialog appears and disappears. I've created a repo with the bare bones of the app and the tests that need...

Protractor not able to count links in a list (li)

javascript,angularjs,selenium,protractor,element
This is my first message, basically because is the first time that I have not been able to find the answer to my question. I am trying to count the number of li elements in a dropdown. Each <li> has a` link. Here is the HTML code: <div ko-dropdown="ko-dropdown" ng-keyup="onKeyup($event)"...

Protractor - How to get first or last CHILD value

angularjs,testing,protractor
I have some HTML which looks like this: <div class="label label-primary ng-scope" ng-if="vehicle.manufacturerCode"> <strong class="ng-binding">AUDI</strong> <small class="ng-binding">[00]</small> <span class="btn btn-flat" ng-click="axCarSearch.removeIdentification(1, $event)"> <span class="glyphicon glyphicon-remove-sign"></span> </span> </div> From this HTML i need to get values of first or last ng-binding. I can imagine I can get to vehicle.manufacturerCode with something...

Selector that will allow automatic Submit button click

javascript,testing,selenium,protractor,end-to-end
I have a 'Submit' button that becomes clickable after another action takes place. In this case, the user has to click the TOS checkbox and then the button becomes clickable. I cannot find a selector that will allow me to automate clicking the Submit button. When you click the Submit...

Protractor map function returning undefined

javascript,selenium,testing,selenium-webdriver,protractor
Given an app with multiple widgets on it, each with their own title and whatnot, I would like to map each widget's elements, to make them easy to handle in tests. For example, a page: this.widgets = element.all(by.css('ul.widget-grid')).map(function(widget, index) { return { index: index, title: widget.element(by.css('div.title')).getText() }; }); And then...

Install Selenium Server manually to work with Protractor (AngularJS) from Cuba

angularjs,selenium,protractor,e2e-testing
I am developing an AngularJS app, and I like to test it with Protractor (e2e test). I am following this excelent guide, but I am stuck in step 5 (Download and start the selenium server), because a live in Cuba and when I try to install the Selenium Server I...

Given a list of links, how do I click and validate each one using C# or Protractor, with Selenium?

javascript,c#,selenium,jasmine,protractor
Code below is in C#, but I also know javascript/protractor. Looking for any pattern that works. var links = driver.FindElements(By.TagName("a")); foreach (var ele in links) { if (ele.Displayed == false) continue; if (ele.Enabled) ele.Click(); System.Threading.Thread.Sleep(3000); driver.Navigate().Back(); System.Threading.Thread.Sleep(3000); } Without the sleep above (which I don't like) the page hasn't settled...

Is there a before() function in Protractor?

angularjs,node.js,automated-tests,protractor,hierarchy
I am aware there is a beforeEach() function which I am currently using. However, I would like to be able to run a before function for all my parent level 'describes' and not the 'it' functions within them. For example my test looks like this (with an x in front...

Quickly access point in UI

angularjs,protractor
We have quite and extensive wizard UI flow and in order to test development changes (e.g.: DOM chanes) at the end of the flow we need to go through all the steps every time since there is data dependancy gathered in previous steps. This is tedious, takes a lot of...

Asserting $http request payloads without mocking them

angularjs,protractor
I'm writing Protractor tests to verify the successful creation of reports in our application. A report is created via a series of complex UI interactions within a dialog and saved via an AJAX POST request to a REST API. I've written tests for the complex UI interactions within the modal,...

how to return object from protractor

javascript,angularjs,selenium,testing,protractor
I have written following code to return text from the table. Now, I want that thing in here: dnassgn is page name, but after calling that function the return value is coming as blank. Please suggest me where I am wrong. fetch_text_from_cell_in_table: function(col_val){ var name_var=""; var km = 0; var...

Protractor synchrozation - timeout

javascript,angularjs,testing,protractor,end-to-end
I am writing simple protractor test four our application: login page is without angularhs - working fine all other pages are with angularjs When i want to write angularhs test - i got this error (following this installation) : Timed out waiting for Protractor to synchronize with the page after...

is there a getConfig() for Protractor?

protractor
I've the following config.js file: var testName = 'Testing'; var HtmlReporter = require('protractor-html-screenshot-reporter'); var reporter = new HtmlReporter({ baseDirectory: './protractor-result', // a location to store screen shots. docTitle: 'Report Test Summary', docName: 'protractor-tests-report.html' }); exports.config = { seleniumAddress: 'http://hub.browserstack.com/wd/hub', multiCapabilities: [ { name: testName, browserName: 'Chrome', browser_version: '39.0', os: 'OS...

String variable is not accepting “?” sign

javascript,string,variables,protractor,sign
I made code with: element(by.className('charge')).getText() .then(function(text){ var blabla = "Is this my string?"; expect(text.match(blabla)).toBe(true); console.log(text); }); And even is output of my console equal to my blabla variable, I'm getting result: Expected [ 'Is this my string' ] to be true. without any "?" sign. How is it possible?...

Protractor cannot find angular came from non angular site

javascript,angularjs,protractor
In protractor I search for a LinkText Login thats worked fine. I were redirect to the login site (non angular) and type in the username and pw. Clicking the submit button i came back to the first site. Now the Login Button is a Logout button. But protractor cannot see...

Protractor cannot perform click actions within while loop inside an element.all statement

javascript,jquery,protractor
in the while loop within the element.all statement, I am trying to highlight an element on a table by clicking on it, then clicking the remove button followed by 'OK' on a confirmation popup. The problem is that when I run protractor, it looks like the while loop is only...

Protractor - Wait for async promise before doing next

selenium-webdriver,webdriver,promise,protractor,angularjs-e2e
First of all, I've already checked various post and blogs concerning that point and I still can't figure out how to make it correctly. I have tried many different combinaison of : browser wait protractor.controlFlow().execute protractor.controlFlow().await( ...Still no success.. My problem Within my beforeEach function, I'd like to call a...

Protractor invisibilityOf flakiness, throwing NoSuchElementError

javascript,twitter-bootstrap,protractor
I am testing a non angular app using protractor where I have a login helper function in my tests similar to the following: function login() { return waitUntilVisible($('#txtUsername')) .then(function () { $('#txtUsername').sendKeys('tom'); }) .then(function () { $('#txtPassword').sendKeys('*'); }) .then(function () { $('#btnLogin').click(); }) .then(function () { // this is the...

browser.wait() for ng-if directive

angularjs,protractor,angular-ng-if
I have this test: it('should get alert', function() { browser.wait(element(by.css('[ng-if="alert"]')).isPresent()); var alert = element(by.binding('alert')); expect(alert.getText()).toBe('Copy clicked!'); }); for this html: <div ng-if="alert" class="ng-scope"> <br> <b layout="row" layout-align="center center" class="md-padding"> {{alert}} </b> </div> The browser is not waiting for the alert block to be present so the test is failing. If...

Protractor Chained Elements by Using Variables?

protractor
I am trying to keep my pageObjects in Protractor as clean as possible, but have run up against some behavior in selecting sub-elements. This works: var parent = element(by.css('.parent-class')); parent.element(by.css('.child-class')).getText(); However this does not: var parent = element(by.css('.parent-class')); var child = element(by.css('.child-class')); parent.child.getText(); Is there someway to do something like...

Can't get the value in an input with protractor

javascript,angularjs,selenium,testing,protractor
I'm using angularJS to develop an application. To test it I use protractor. I want to check the value in an input area. This is my input: <input id="rank-max-range" class="form-control has-feedback" name="inputMax" type="number" placeholder="Maximum" ng-model="selectedItem.range.max" min="{{selectedItem.range.min}}" max="{{selectedItem.answers.length}}"> And this is the test: it('should be fill the max range with the...

How to set the IEDriverServer.exe through command line in protractor

internet-explorer,selenium,selenium-webdriver,webdriver,protractor
I would like to set the IEDriver executable path via command line while using protractor. I am using the following command, but it is not considering path to the IEDriver executable. cd > protractor --seleniumArgs "['-Dwebdriver.ie.driver=../selenium/IEDriverServer.exe']" conf.js I am getting the error: var template = new Error(this.message); ^ UnknownError: The...

How do I run PHP's built-in web server in the background?

php,protractor,daemon,php-5.4
I've written a PHP CLI script that executes on a Continuous Integration environment. One of the things it does is it runs Protractor tests. My plan was to get the built-in PHP 5.4's built-in web server to run in the background: php -S localhost:9000 -t foo/ bar.php & And then...

Testing items in a list

javascript,angularjs,testing,protractor,e2e-testing
I want to test that the items added to a list have some kind of value in them. My current test looks like: containerDetail.openItemAddModal(); element(by.css('[ng-click="form.section = \'batch\'"]')).click(); element(by.model(batchModel)).sendKeys(batchEntry); // we insert the batch items here element(by.buttonText('Add')).click(); expect(element.all(by.repeater('item in detail.container.items')).count()).toEqual(6); // Would like to test that each item has some text...

Running Karma and Protractor tests with or without a headless browser

selenium,teamcity,protractor,karma-runner,headless-browser
I am confused about running Karma and Protractor on a TeamCity CI server. Should I run these tests with a headless browser or not and how can I do that?

Protractor image upload doesn't work on IE and firefox

javascript,selenium,file-upload,selenium-webdriver,protractor
I am trying to upload image on the input type:file control using protractor. I am using the below code: var basePath='../testdata/testappicons/accepted'; var randomIcon=randomIntFromInterval(1,6); var overallPathToIcon=basePath+randomIcon+'.png'; var fileToUpload = overallPathToIcon; console.log(fileToUpload); var absolutePath = path.resolve(__dirname, fileToUpload) browser.executeScript('$(\'input[type="file"]\').attr("style", "");'); $('input[type="file"]').sendKeys(absolutePath); The above code works well on the chrome and I am able...

setting environment parameter for protractor e2e tests

angularjs,node.js,protractor,angularjs-e2e
We are using protractor to test our front end angular app that we are building. Currently we are using browser.get() to specify our environement we wish to test again(localhost:9000, staging, UAT) however I am wanting to parameterize this so that when we run our tests using grunt test:e2e we can...

Protractor removes element from the dom

angularjs,dom,testing,protractor,e2e-testing
I'm stucked in a test with protractor, because of a strange (and not so cool) behaviour of the template we are using. On page load, the template has on overlay that is going to be hidden after 1 second in this way: $(document).ready(function(config){ setTimeout(function(){ $('.page-loading-overlay').addClass('loaded'); $('.load_circle_wrapper').addClass('loaded'); },1000); }); *That feel...

protractor iframe inside an iframe inside an iframe

testing,iframe,protractor,angularjs-e2e,end-to-end
I'm trying to get to controls inside a frame that is located inside a frame that is located inside another frame. The last (deepest) frame is used only for login - that I manage to do. The problem is that after the login I basically need to return to the...