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.

2
votes
1answer
195 views

Unexpected alerts from Chrome using Protractor

2 days ago I have started to receive unexpected alerts when leaving the page (actions that change the URL really). (those alerts do not appear in a 'real' browser). I have checked the compatibility ...
1
vote
1answer
199 views

How to structure data driven Protractor/JS tests in page object model?

I am using protractor/js for automating end to end tests for our website. We have a test data set that we have saved in different JS files and we use this data while executing test cases. We are ...
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."...
14
votes
4answers
11k views

Moving from Selenium to Protractor

I have been using Selenium/Java/Maven for functional automation testing in my project. But since angular is getting a lot of popularity, the development team has started using it for the development ...
0
votes
1answer
34 views

Why element locators are not suggested in visual studio code for protractor?

I don't get suggestions for "element(by." element locators in visual studio code. Im using protractor. I have changed the settings file also. Settings.js { "editor.quickSuggestions": { "...
0
votes
1answer
24 views

How to fix “Cannot find module” error and “Error: ReferenceError: Element is not defined” in protractor?

I have created a test project using page object model. When I run, it creates "Cannot find module" error. I have tried several answers but didn't work. Here is my code Config.js exports....
0
votes
1answer
32 views

How do I store a value in a global variable and then use it in subsequent steps of a scenario in protractor cucumber typescript based project

I want to retrieve a value in 'Given' function and then store it in a global variable so that the value is accessible in subsequent steps of a scenario in protractor cucumber typescript based ...
0
votes
2answers
45 views

Which is faster: creating a method to reference a web element by label text, or directly referencing the element via a UI?

The automation framework I'm working within has a method in the PageObject file to return a WebElement by its label text: getSubTab : { value : function(value){ return this.navTabs.filter(...
0
votes
0answers
19 views

How to access Angular component variables in protractor E2E test?

In Angular JS, there is an option to set and get the controller variables via protractor using "Evaluate()" function like in the below example, > element.all(by.repeater("address in addresses"))....
1
vote
1answer
72 views

Writing different tests for different environments

We didn't implement automated deployment yet to our Angular 7 project, so environment-based variables (e.g baseUrl) are changed manually, causing the application to crash after deployment a lot due to ...
2
votes
1answer
73 views

How to explicity fail e2e tests on unexpected behavior?

I am currently using protractor but the idea would be similar for any flavor of Selenium. Right now, depending on which step the test is on, my current framework will wait for elements to be ...
0
votes
2answers
264 views

Protractor using Typescript and cucumber

I need to click on 'homebutton' button of a angular website through typescript in protractor and after clicking need to check that i am on homepage of the website. can anybody tell me this?
0
votes
1answer
316 views

unable to run test cases in IE browser in protractor, selenium framework for angular.js web application

I was trying to execute test cases in IE, and I am facing errors as shown in error picture, my config file is shown below. using IE 11.09 with selenium webdriver-4.0.0 in windows server 2012 R2 ...
2
votes
1answer
764 views

Protractor- in same page how to switch from non angular to angular, its clicking on non angular elements but not on angular?

In same page how to switch from non angular to angular, it is clicking on non angular elements but not on angular, when click on non angular lookup then angular window(Popup) will open
3
votes
2answers
177 views

Protractor Image didnt upload on dialogue box?

I want to test the image upload functionality using Protractor but my written script didn't work. When we click on the dialogue box image it opens the window to select the desired image. After the ...
-1
votes
1answer
64 views

Transition from selenium to protractor - worth it?

Over the last few weeks, We have been experimenting with a protractor+typescript+cucumber framework for our new Angular 6 application. The main reason we thought our present Selenium+Cucumber+java ...
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, ...
0
votes
0answers
16 views

Webdriver instances not created for custom protractor.conf file

I want to integrate my E2E suite in Travis, so I followed this article. As mentioned in the article I've created a custom protractor.ci.conf.js file of the Travis build. I've placed this file inside ...
2
votes
1answer
2k views

Unable to run Protractor tests in Microsoft Edge

I'm working on a project to begin testing Node/Angular applications using Protractor and Jasmine. I have a POC working in most browsers but having a lot of trouble with MS Edge. Here's my ...
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
315 views

ElementArrayFinder.filter() - how does it work under the hood?

In my UI, I have a project tree that contains a list of components that are in a project. Once my current spec is done running I'm calling a page object function to delete all the components to clean ...
3
votes
2answers
131 views

How to structure automated tests for feature with two dashboards?

I'm going to prepare e2e tests for chat app with two customer dashboards. First (written in Angular) is accessible from desktop browsers and second (Ionic) through mobile devices. When customer ...
0
votes
1answer
84 views

Appium + Protractor : element not intractable

I am using Appium and Protractor for e2e testing of my Ionic 4 application. The application Starts from the login page. Currently, I have implemented my spec.ts file as below import {browser, by, ...
2
votes
1answer
156 views

How to Verify the string / text by using Protractor

I want to verify that one screen string value with other screen string value. For example, if I try to select one product from the product list screen, the product detail screen is opened which is ...
11
votes
8answers
46k views

Why can't we use Selenium Webdriver to test Angular JS sites?

If we look at the Protractor architecture, Protractor uses WebDriver JS to call Selenium Webdriver which ultimately calls browser driver and then browser. Now since Selenium is passing commands to ...
1
vote
1answer
64 views

how can I find element on next page, while it is not presenting on present page?

I have a total of 200 users. I have one angular page which has showed 20 users on the present page. Now, I want to find a random user which is in any next pages. I have page navigator button on the ...
1
vote
1answer
274 views

How to attach screenshot to protractor's HTML report?

In my protractor project, i am trying to take an screenshot, and attach it to my html report. The process of taking screenshot is happening in an After hook, as below: import { Status,After, ...
2
votes
1answer
2k views

How to use async/await with Protractor-nodejs8

I am completely new to protractor, and I came across the async/await. Is it necessary to use async/await in all your script. And how to use with page object. Using node version 8.9.4 protractor ...
1
vote
2answers
222 views

Maximizing Chrome Window size in Jenkins for Protractor Tests

We are in the process of setting up Jenkins for our testing projects and we are facing a huge challenge for browser window size. The app we are testing is a Progressing app so with the default screen ...
2
votes
0answers
67 views

Protractor: Getting 'Failed: Unknown error' for test running in Edge Browser

Protractor Version: 5.3.0 Edge Version: 38.14393.2068.0 Edge HTML: 14.14393 MicrosoftWebDriver.exe version: 10.0.14393.0 Windows 10 Enterprise 64-bit seleniumAddress: 'http://localhost:17556/', ...
0
votes
1answer
54 views

how do I define global variable in conf.js and used in spec.js file in jasmine protractor?

describe('Enter Base API URL', function() { it('1st scenario', function() { // Take any URL. browser.get('xyz.com'); browser.ignoreSynchronization=true; var user= by.xpath('//...
1
vote
1answer
69 views

Cucumber Protractor tests is returning 0 scenarios

I was trying to run a sample test in cucumber protractor javascript tests. But it is returning 0 scenarios.Could someone please look into my code pasted below. sample_scenario.feature Feature: To ...
2
votes
2answers
2k views

Scrolling to Bottom of the Text Area using Protractor

I have a text field that I need to scroll to the bottom of in order for the Next button to be activated to click. This project is using Angular 6 my tests are end to end test running on the protractor/...
5
votes
2answers
697 views

Using SuperTest/Protractor on unsecure HTTPS

I am trying to run automated API tests on localhost with an invalid cert. Is there a chromeOption equivalent to "Proceed Anyway" that I can pass to the tests so they can get a response from the url? ...
2
votes
1answer
411 views

Protractor ConfigParser Error 105 getPage Timeout when trying to print to console

In Protractor, I need to run one line of code from the test suite called mytest: console.log('my first Protractor test'); I am not loading any webpages. I am only printing to the console. I have ...
1
vote
2answers
114 views

How to enter acceptable fake data to login page which is tests using protractor?

I am completely new to the protractor and currently, I'm testing my login page using my own login data and I want to use dummy data as profile login data. Can these enter in my spec.ts file or ...
2
votes
1answer
1k views

Parallel protractor tests are still running sequentially

Looking For: I want to run Specs in Parallel. Tried: Included in config file: shardTestFiles : true, maxInstances: 4 Output I see: Multiple instances are not opening. Still running in serial. **...
0
votes
1answer
91 views

Get value from element of type <a>

So this is the HTML <ul class="has-status sub-menu"> <!-- ngRepeat: subItem in item.subMenuItems track by subItem.name --> <li ng-repeat="subItem in item.subMenuItems track by ...
0
votes
1answer
246 views

How to find radio button value and ID with xpath

<rhr-radio-button element-id="tenderValidType" model="$ctrl.additionalData.procProcedure.tenderValidType" value="UNTIL_DATE" label="additionalData.tenderValidUntil" required="::$ctrl.requiredFields[...
5
votes
2answers
3k views

PROTRACTOR:How to tell protractor to stop or skip the TEST if any Test case is failed

Current Behavior: If any TestCase is Failed, Protractor not continuing with the next Testcase and holding to the same failed Testcase . Waits for long time and throws A Jasmine spec timed out. ...
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 ...
2
votes
2answers
553 views

Protractor: Iterate through table <td> and click the link by TEXT

Requirement : link is present inside tabel >td>p>a . i want to Click link the link by TEXT (something like contains(Text)) Tried : by.CssContainsText("a","Text") . did not work, as multiple entry ...
1
vote
1answer
48 views

Same element locators under different parents

This is more of a "code review" question but it is very SQA specific so posting it here. There are two different menus on a page: "left" and "right" both containing "save" and "cancel" buttons with ...
1
vote
2answers
89 views

'to.include' is not working where 'to.eventually.equal' is working

I was trying to check whether a string is present in another string. I am using the below code: expect(actualTimeZone).to.include(employee.timeZone); But it is giving the below error: ...
2
votes
1answer
67 views

getText() which is in between <div> </div> tag?

Get text which are in between tags DOM <div id="div_ResultMessage" class="AlertmsgDiv"> <div id="lblSuccessMessage" class="alert alert-success alert-dismissable"> <div ...
1
vote
1answer
3k views

Running Protractor tests from Jenkins

Usually, I used to run from command line (protractor config.js). I used protractor and java script. PLS LET ME KNOW STEPS TO ACHIEVE RUNNING FROM JENKINS To run from Jenkins , I created a batch file ...
0
votes
0answers
272 views

How to Debug Protractor test written in typescript?

I have an typescript project with protractor. I could able to add debug point to the transpiled javascript launch.json { // Use IntelliSense to learn about possible attributes. // Hover to view ...
0
votes
1answer
233 views

Why does Selenium suddenly skips all my tests?

I'am used to run the E2E test couple of times a day during development... Today It suddenly skips all my test and all my spec files register.e2e-spec.ts I didn't do any changes or updates on my spec ...
1
vote
1answer
370 views

Can Jasmine tests be executed in a specific order?

I believe it is considered to be a bad practice to rely on the order in which the (acceptance) tests should be run, but for testing "deeply nested features" (I don't know if there is a standard term ...