Search Posts

Category: selenium

Protractor hangs at "Selenium standalone server started "

My team recently switched from starting the webdriver-manager manually, to specifying the selenium server in the conf.js file, as specified here: https://github.com/angular/protractor/blob/master/docs/server-setup.md#standalone-selenium-server. I’m trying to run Protractor with the following conf.js, which takes a few arguments and then returns a configuration object: //create-conf.js ‘use strict’; const path = require(‘path’); const globalData = require(‘./globalData’); module.exports = (confLocation, specs, reportDirName, browserName = ‘chrome’) => { // We want the reports to be saved relative to the config, […]

AngularJS- synchronisation within automated testing?

I am developing a suite of automated tests for an AngularJS application using Protractor, and am having a bit of trouble with the test that I am currently writing: The purpose of the test is to click one of the menu items, and check that it redirects the user to the correct page. This particular criteria does currently pass, however, I need this test to perform one other action before it can complete- the page […]

Moving Protractor tests to async/await (leaving selenium control flow)

I want to move appart from the selenium control flow in my Protractor tests. Here are the steps and problems I went through so far: 1. Disable it test by test My first idea was to use SELENIUM_PROMISE_MANAGER in order to move from selenium promises to async/await code. Unfortunately, I found no way to put one test to SELENIUM_PROMISE_MANAGER=0 while keeping others to SELENIUM_PROMISE_MANAGER=1 in order to do the migration smoothly. 2. Keep it but […]

JavascriptExecutor is not working with AngularJS forms

I am trying to automate a login form by Selenium Webdriver (JavascriptExecutor) which is built in AngularJS. The script is entering data in textbox; but when submit button is clicked error message shows that textbox is not filled. I have also used events like onkeyup(), blur(); but error shows these are not functions. Textbox validation works fine with sendkeys() and it takes time; but facing issue when JavascriptExecutor is used. http://oditek.in/ikomplianzWeb/client/ html code: <input id=”email” […]

Multiple Angular requests cause errors within tests

I’ve got an Angular 1.5 app with a Rails 4.0 backend and I’ve got this problem where in my tests once a Staff member logs in 3 queries are sent to the backend at the same time. In testing (using Capybara + selenium + chromeheadless) this causes these requests result in errors on the backend. In development it works fine. An example of the error; NoMethodError at /entities/get_current_entity ============================================= > undefined method `fields’ for nil:NilClass […]

Browserstack not executing e2e test cases

I have e2e test cases in my Angular 4 app, using command ng e2e all of my 6 test cases are passing successfully, but when I try to run them in browserstack: ng e2e –no-serve –conf=./protractor.browserstack.conf.js –specs=./e2e/myTestCases.e2e-spec.ts –base-href=http://MY.IP.AD.DR:4200 I’m getting this message after a while: (node:8872) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead. [11:31:30] I/update – chromedriver: file exists C:pathtoMyAppnode_modulesprotractornode_moduleswebdriver-managerseleniumchromedriver_2.32.zip [11:31:30] I/update – chromedriver: unzipping chromedriver_2.32.zip [11:31:30] I/update – chromedriver: chromedriver_2.32.exe up to date […]

NgWebDriver waitForAngularRequestsToFinish() is not working

I am trying to implement NgWebDriver using Selenium Java for angular app. As per NgWebDriver documentation we have to only pass new NgWebDriver(driver).waitForAngularRequestsToFinish(); driver instance but when I am trying to implement it , I have to cast argument to JavascriptExecutor otherwise its giving error in the syntax. System.setProperty(“webdriver.chrome.driver”, “/path/to/chromedriver”); WebDriver d = new ChromeDriver(); NgWebDriver ngdriver = new NgWebDriver((JavascriptExecutor) d); ngdriver.waitForAngularRequestsToFinish(); When I use this code after casting driver instance as than its not […]