Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [protractor]

An end-to-end test framework for AngularJS applications. Protractor runs tests against applications running in a real browser, interacting with it as a user would.

3
votes
2answers
8k views

How to handle windows authentication pop up with Protractor?

Use case: When URL loads, it request for Windows authentication (Enter Username and Password). How it goes is: loads the url on clicking Post button in the page. Windows Authentication pops up ...
1
vote
1answer
924 views

How many 'it' can we define inside a describe block?

I am using Protractor for e2e testing. I want to know, How many 'it' we can define inside a 'describe block' in a test file like below- describe('This is my test suite',function(){ it('This is ...
7
votes
3answers
4k views

Cypress vs Protractor for end-to-end testing

I've recently stumbled upon a modern end-to-end testing framework called Cypress which is going to be released in public beta this year. It really looks awesome at the first glance - there are ...
6
votes
1answer
301 views

Exception thrown: Keeping the Selenium server alive

I am doing protractor test, and I am using ExpectedConditions as below. var EC = protractor.ExpectedConditions; var el = element(by.css('[class="loader-class ng-scope"]')); browser.wait(EC.not(EC....
1
vote
1answer
169 views

I want to run report(.html file) of protractor-html-reportor

I am doing end-2-end testing with protractor. And for creating a report of all these test cases, I am using protractor-html-reporter, which creates an .html file as report of all these test cases. ...
1
vote
1answer
2k views

How to verify column count using protractor

I need to verify the column count of a table based off of the security role of the logged in user. How can I verify that in some instances 5 columns are displayed but in other instances 4 or 3? The ...
2
votes
1answer
3k views

How to close print dialog box in protractor test

I am doing end-to-end testing with protractor. In a certain test, I need to test like print button is creating pdf or not. So When Test clicks the button, It opens the print window dialog like below. ...
0
votes
1answer
2k views

How to verify that the menu items (tab/column Elements) are clickable? or Unclickable?

Test Case In My web page, I have 5 tabs (A,B,C,D,E) in which 2 tabs (A,B) are clickable and 3 Tabs(C,D,E) are not clickable. Write a script to verify those tab elements are clickable or not. What ...
0
votes
1answer
377 views

How to test a third party editor in protractor

I need to automate a portion of the platform that involves opening a third party editor (BeeFree) and add contents to the editor. The editor is used to create email templates and main content (text, ...
1
vote
1answer
276 views

Verify specific text with same locator and verify generated spreadsheet using Protractor

How can I verify specific text within an unordered list using Protractor? Here is a sample of the code <ul class="list-unstyled"> <li ng-repeat="field in parsedTemplate.fields" class="ng-...
4
votes
4answers
10k views

How should I find the XPath using selenium webdriver and protractor

I'm a beginner in automation testing. I'm trying to select a value from data list and I got an XPath like mentioned below: XPath : html/body/div[2]/div[1]/div/div[1] This is the HTML for the same :...
1
vote
1answer
511 views

Handling unstable remote selenium server connection

We are currently running end-to-end tests on BrowserStack and tackle flakiness of tests on a daily basis. One of the recent problems was that rarely Protractor temporarily loses connection to the ...
8
votes
3answers
714 views

End-to-end tests are running for 5 hours

This is a continuation of Speeding up end-to-end tests topic, but a more specific one. Currently, it takes ~5 hours for our daily end-to-end testing run to complete. What can we do to improve on ...
1
vote
1answer
746 views

Verify baseUrl with prepended/appended text in protractor test

I'm using a baseUrl in the config file and some tests access links that have prepended/appended text to the same url that needs to be verified. How can I verify the clicked url while using the baseUrl?...
2
votes
1answer
105 views

How to verify text order/position?

How can a protractor test verify the location and order of text on page? Our application generates schedules that is comprised of divs in specific orders depending on the date/time and type of ...
-1
votes
1answer
629 views

I'm unable to install protractor [closed]

Error in cmd C:\Users\user>npm install -g protractor npm ERR! Windows_NT 6.1.7601 npm ERR! argv "E:\\Software\\nodejs\\node.exe" "E:\\Software\\nodejs\\node_modul es\\npm\\bin\\npm-cli.js" "...
0
votes
1answer
366 views

Locate a link and copy it without clicking in protractor

I need to locate a link on the page and copy it or store it as a string without clicking it in a protractor test. I can locate the element but am not sure how to store it as a string. Suggestions?
1
vote
0answers
358 views

Protractor port option error when trying to upload a CSV file

I'm receiving the following error in a protractor test when trying to upload a CSV file. - Failed: "port" option should be >= 0 and < 65536: 100000 I inherited these tests but there is no ...
1
vote
2answers
5k views

Protractor: How to verify text present in the table row?

TestCase: Verify the table ROW contains text. To verify text present in Table Row, i tried Using "expect.gettext().toContain(datefinal)". But ouput returns "Expected '7/18/17' to contain undefined."...
0
votes
1answer
81 views

Issues locating start/end times with protractor

I am having issues locating the text of start and end times on our web application using page objects. Below is the code, the only thing that will change is the time (in between ::before and ::after). ...
1
vote
2answers
76 views

Options for @findAll in protractor

I want to use two identifiers for the same element and use the first one found. With Java, we have @findAll. Is there any way to that with javascript protractor? Any function/options or something ...
1
vote
1answer
3k views

Change a URL to be environment specific in protractor test

I have a protractor test that locates a URL on a page. The URL is then clicked and expected to contain specific text. The URL needs to be manipulated before the browser opens it, how can I change the ...
5
votes
2answers
2k views

Speeding up end-to-end tests

When we execute the same set of end-to-end browser-automated tests on BrowserStack, we notice a dramatic slowdown - tests are much slower than if executed locally and there are occasional failures ...
2
votes
1answer
280 views

Average protractor test script length?

Looking for protractor best practices of sorts, is there any recommended 'average' length or size of an individual end to end test? Our platforms features are all highly dependent upon on another so ...
1
vote
1answer
674 views

Add reusable code to existing protractor page objects file

I inherited 45 spec files with correlating page object files that are used only to locate elements on the pages. I am trying to create reusable code, is it best practice/can additional exports be ...
3
votes
2answers
1k views

Locate an element by uib-tooltip in protractor?

I'm having issues locating 'events' on our platform. Each time an event is created, a div card is added to the page at the end of the events. Ideally I'd like to run tests in parallel so picking up ...
3
votes
1answer
791 views

How to debug events not firing after clicking continue button?

I have an automated script that fills out guest information and clicks a 'Save and Continue' button to proceed to the next page. The button is being clicked correctly because it becomes disabled but ...
1
vote
1answer
3k views

Locating ng-click in protractor

I cannot figure out how to locate ng-click in the page object file for the code below: <a ng-click="toggleGuestParams('personal')" class="ng-click-active">Select/Unselect All</a> There ...
5
votes
1answer
131 views

Test Quarantine in Protractor

Follow-up to How to deal with flaky tests? One of the approaches to tackle flaky tests is to temporarily quarantine the tests - move them to a special "bucket" with other flaky tests: I offer one ...
6
votes
2answers
1k views

Switching from JavaScript to TypeScript for Protractor e2e tests

Not very long time ago, Protractor itself migrated to TypeScript internally. I've also heard and seen several Protractor test projects moving to TypeScript. We have a rather big and growing test ...
7
votes
2answers
5k views

Organizing and maintaining protractor test files within multiple suites

I am just getting started with Protractor and inherited roughly 40 automated test cases. They are currently meant to run sequentially and are not organized or built to run independently. I am taking a ...
2
votes
0answers
513 views

Unable to add/attach screenshot and test steps in Report

I am working on protractor and using "protractor-angular-screenshot-reporter" to generate the report.But i am unable to add screenshot and test steps in this report.Can any one please help me in this....
2
votes
1answer
907 views

Attaching screenshots to JUnit test reports

We run our tests on Jenkins using Protractor generating a JUnit XML test report via JUnitXmlReporter from jasmine-reporters. Is it possible to attach screenshots, with the current state of an ...
4
votes
3answers
270 views

How to profile end-to-end tests to find the slow ones?

The Story We have a big end-to-end test codebase written in Protractor/WebDriverJS. We are using jasmine-spec-reporter for the command-line test reports. It reports test execution time for every ...
1
vote
0answers
399 views

Unable to run the Protractor tests in safari browser and build failed

My safari browser unable to locate the elements also and used so many delays: My Configurations are: iMAC Version: 10.11.6 OS X El Capitan Safari Version: 10.0.3 Protractor version: 5.1.1 ...
3
votes
1answer
357 views

Using Functional programming for UI Test automation

From what I have read about functional programming, it is considered to be more concise, more testable, and have fewer side effects. Would it be good to use for UI test automation? Context: I am ...
0
votes
1answer
233 views

How can I find text for span within span?

Following is my code: <span id="agText" class="ag-header-cell-text"> <span style="height: 100%;">Coordinator</span> </span> I was trying the following: var cordinator = ...
1
vote
3answers
1k views

How can I locate the navigation element by text?

<li class="nav-item" ng-reflect-ng-class="nav-item,"> <a class="nav-link" href="javascript:void(0);"> <span>By Coordinator &amp; Salesman</span> <!-...
1
vote
2answers
15k views

Handling DropDown using Protractor

I am facing issues with handling a trivial scenario during automation. I need to select a specific option using Protractor. I am passing the index of the option that I want to select, and then ...
2
votes
2answers
812 views

How to test export functionality?

I have a scenario to test where I need to test that the export functionality is working properly or not. I know that usually in these cases, firstly we check the availability of file in location and ...
2
votes
1answer
686 views

Selenium vs Protractor - how to choose [closed]

Selenium or Protractor? In what circumstances is Protractor a better tool for testing a web application than Selenium? I often see interview questions about Selenium, but Protractor seems to me to ...
10
votes
3answers
11k views

Why should we use javascript for UI test automation?

Background:JavaScript based automation frameworks heavily depends on asynchronous execution, promises, callbacks, anonymous functions, etc which are inherently complex and probably an overkill for a ...
3
votes
1answer
528 views

WebDriver Error Cannot use 'in' operator to search for 'String' in false

I have been using selenium webdriver with protractor for more than a year now and recently after updating to the newest versions i got an error that i have never encountered before. As stated in the ...
2
votes
1answer
815 views

Protractor can't see the file just downloaded into the folder

// gives count of downloads in download folder. this.getCountOfDownloads = function (fileName,elementToClick) { //provides a way to look for filenames matching a certain pattern (in the worst ...
4
votes
2answers
3k views

How to clear a directory before running Protractor tests

I have a Protractor test to validate that an excel file is correctly downloaded in the Downloads folder and then I am able to upload the same. Since I will be running the test multiple times, I need a ...
8
votes
2answers
767 views

Canonical way for multi-session browser testing in Protractor

The Question: What is the canonical way to write multi browser window tests in Protractor - the tests that involve multiple sessions fired up interacting with one another? The Story: The main ...
3
votes
1answer
404 views

How can I add headings to my protractor-jasmine2-screenshot-reports

I am sharing my spec file, the generated report contains only 'through Gmail Account' text but I want to add 'Password pop up' text and many other headings also. I tried by adding one more 'it' block ...
3
votes
1answer
1k views

Separate configurations for different environments on protractor

For example local, qa, and production. Each of them has different URL. So I expect to contain something in URL. So I need to take some parameter from console where I run the protractor. I run ...
1
vote
2answers
3k views

How to check if a file with random changing name is downloaded using protractor selenium? [closed]

This is the path of file capabilities: { 'browserName': 'chrome', 'chromeOptions': { prefs: { download: { 'prompt_for_download': ...
3
votes
2answers
7k views

How to check if a file is downloaded using protractor selenium?

This is the path capabilities: { 'browserName': 'chrome', 'chromeOptions': { prefs: { download: { 'prompt_for_download': false, ...