Category : selenium

I have an angular app with enabled ViewEncapsulation.ShadowDom, inside which there is an iframe. When I’m trying to write protractor test I’m getting an error: Failed: unknown error: no element reference returned by script While I’m able to actually get web element, I can’t perform any actions with it. const root = element(by.css(‘app-root’)).getWebElement(); browser.driver .executeScript(‘return ..

Read more

When trying to run e2e tests in a new Angular application created today: Error: SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 90 chromedriver=90.0.4430.24 appears to be requiring Google Chrome V90. Unfortunately, this version of Google Chrome is still in beta. Anyone know any way to resolve this? Source: Angular..

Read more

I am trying to access the elements in the dropdown. Unlike other drop downs that have the options and values written in one place. Like this: <select> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select> This dropdown has it’s elements or attributes referenced to another file. <div class="row"> <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4"> <div ..

Read more

I know there are several threads with this topic but none of the solutions i’ve found have worked for AngularJS v1.6 So here is what i’ve tried: public void waitForAngularRequestsToFinish() { while ((boolean) jsExec.executeScript( "return (typeof angular !== ‘undefined’)? true : false;")) { jsExec.executeAsyncScript( "var callback = arguments[arguments.length – 1];" + "angular.element(document.body).injector().get(‘$browser’).notifyWhenNoOutstandingRequests(callback);"); } } This ..

Read more

I am writing test automation for Ajenti2 With Selenium for Python I need to disable animation: progress bar, buttons, icons, etc I found it: $animate.enabled() here https://docs.angularjs.org/guide/animations But i can’t figure out how to apply it. This works in: https://plnkr.co/edit/ It doesn’t work in DevTools console, or by adding a script to the template: https://github.com/ajenti/ajenti/blob/master/plugins/core/content/pages/index.html ..

Read more

I am using protractor with angular application. What I have in my page model is as follows: export interface TileElement { idx: number; icon: string; title: string; element: WebElementPromise; } getModels() { return $$(‘mat-card’).map((e, idx) => { // e.click(); return { idx, icon: e.$(‘mat-card-content div:nth-child(1)’).getText(), title: e.$(‘mat-card-content div:nth-child(2)’).getText(), element: e.getWebElement() }; }) as Promise<TileElement[]>; } ..

Read more

I’m writing Selenium tests in C# with Specflow and Nunit for a new project i’m working on and nothing inside the body can be selected anywhere at all I can access body with WaitUntil(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(By.CssSelector("body"))); but can not of the following work and throe element not found exceptions: WaitUntil(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(By.CssSelector("halo-root"))); WaitUntil(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(By.CssSelector("halo-entry"))); WaitUntil(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(By.CssSelector("halo-navigation-container")));` etc error: no such element: ..

Read more

I want to check if the list returned from the application contains the expected element.Please let me know where am going wrong : this.verifyOptionsInDrpDwn = async function(){ var optionList = await drpDwn.all(by.tagName(‘option’)).getText(); console.log(optionList); var expOptions=[‘a’,’b’,’c’,’d’,’e’,’f’]; for (let i = 0; i < expOptions.length; i++) { var bool=optionList.includes(expOptions[i]); console.log(bool); } } output : [ ‘1-a’, ‘2-b’, ..

Read more