Search Posts

Category: selenium-webdriver

Stress test angularJS application (Jmeter)

I have Jmeter and webdriver plugin (chrome, firefox, phantomJS …. The problem is when i launch scenario with multi threads all headless (Chrome, PhantomJS) open the first thread and log into but all other threads don’t log in, the reason we are already connected on the application (the aim have several users same time on the application), i don’t know how to isolate session like firefox (the problem with firefox is not headless and only […]

How to select drop down list when object/value is always changeable in protractor

Anyone can help me how to call the drop down list for protractor? The highlighted object is not fixed value/object. Means it always changed. The below code is not working for me: element(by.model(‘residential’)).$(‘[value=”object:353″]’).click(); AngularJS as per below: <select class=”form-control ng-pristine ng-valid ng-not-empty ng-touched” ng-model=”residential” id=”ResidentStatus” ng-options=”status as status.Name for status in residentialStatus” style=””> <option value=”” class=”” selected=”selected”>Please Select Resident Status option label=”Malaysian” value=”object:353″>Malaysian</option> <option label=”Non-Malaysian” value=”object:354″>Non-Malaysian</option> </select> I hope someone can give an idea for […]

How to switch frames using Protractor

I know this has been asked multiple times, and the suggested solution has been to use something like browser.driver.switchTo(‘your-frame-name’) but I can’t seem to access the same switchTo() method in my code. This is my test : import { AppPage } from ‘./app.po’; import {browser, by, element} from ‘protractor’; describe(‘angular-test App’, () => { let page: AppPage; beforeEach(() => { page = new AppPage(); }); it(‘should display welcome message’, () => { page.navigateTo(); browser.driver.switchToParentFrame() //expect(page.getParagraphText()).toEqual(‘Welcome […]

Error: Can’t resolve ‘child_process’ Angular-cli

I generated a new application using angular-cli and added few components. I haven’t added any test cases. when I try to run/build the app, I get the following lengthy error message: ERROR in ./node_modules/selenium-webdriver/firefox/binary.js Module not found: Error: Can’t resolve ‘child_process’ in ‘/home/myName/PROJECTS/MEAN/fruit-stall/fruitStall/node_modules/selenium-webdriver/firefox’ resolve ‘child_process’ in ‘/home/myName/PROJECTS/MEAN/fruit-stall/fruitStall/node_modules/selenium-webdriver/firefox’ Parsed request is a module using description file: /home/myName/PROJECTS/MEAN/fruit-stall/fruitStall/node_modules/selenium-webdriver/package.json (relative path: ./firefox) Field ‘browser’ doesn’t contain a valid alias configuration after using description file: /home/myName/PROJECTS/MEAN/fruit-stall/fruitStall/node_modules/selenium-webdriver/package.json (relative path: ./firefox) […]

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: 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, […]

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(“”, “/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 […]