Testing Salesforce webdriver iframe using Protractor with TypeScript

While trying to automate the creation of a new application form in Salesforce Lightning, I encountered an issue when switching into the iframe:

In the node_modules\selenium-webdriver\lib\webdriver.js file at line 182, I received the following error: RangeError: Maximum call stack size exceeded. Exception in PromiseRejectCallback: \node_modules\selenium-webdriver\lib\webdriver.js:189 value.then(toWireValue).then(setValue, reject);

iframe:ElementFinder=element(by.xpath("//div[contains(@class, 'iframe- 
parent')]//iframe"));
async fillPersonalInformation() {
browser.ignoreSynchronization = true;
browser.switchTo().frame(this.iframe);
await this.firstName.sendKeys("hii");
}

Answer №1

It seems like the best approach would be to utilize getWebElement().
Substitute

browser.switchTo().frame(this.iframe);

with

browser.switchTo().frame(this.iframe.getWebElement());

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Selenium: Waiting for visible elements in findElements even if there are invisible elements present

Our goal is to send keys to an element identified by name, even if there are multiple elements with the same identifier. To achieve this, we use a code snippet like the following (this is simplified code for demonstration purposes only): List<WebElemen ...

What is the best way to access the statistics for each game on a live score platform?

I am looking to retrieve the statistics for each game on livescore and gather all the stats of all games in a day simultaneously. driver.get('https://www.livescore.com/en/football/2022-12-01/') time.sleep(2) scroll_pause_time = 1 # You can adjust ...

What sets apart Record<A, B> from {[key: A]: B} conceptually?

Can you explain the distinction between type A and type B? Type A = {[key: string]: string | number | boolean | null} Type B = Record<string, string | number | boolean | null> ...

What is the process for creating a TypeScript type that is generic and includes a keyof property?

Looking to create a generic type that can be used as an argument in a function, but struggling with defining strongly typed property names (specificProperties in the example code snippet). type Config<T> = { specificProperties: keyof T[], dat ...

Utilize TypeScript enum keys to generate a new enum efficiently

I am in need of two Typescript enums as shown below: export enum OrientationAsNumber { PORTRAIT, SQUARE, LANDSCAPE } export enum OrientationAsString { PORTRAIT = 'portrait', SQUARE = 'square', LANDSCAPE = 'landscape&ap ...

Simulated FTP Connection Setup and Error Event in Node.js using Typescript

In my Node-Typescript-Express application, I am utilizing the FTP library to connect and retrieve files from a designated location. As part of creating unit tests, I am focusing on mocking the library to ensure coverage for code handling Ready and Error ev ...

What is the best way to outline the specifications for a component?

I am currently working on a TypeScript component. component @customElement("my-component") export class MyComponent extends LitElement { @property({type: String}) myProperty = "" render() { return html`<p>my-component& ...

Tips for retrieving the text content of an <h1> element within a div using selenium

Can someone please help me figure out how to obtain the text of h1 in Selenium? I'm new at this and not sure what to do. Thank you in advance. Please ignore '\' at the beginning tag of h1 and div. <div class="on minimum covera ...

Ensure the presence of a value in an array using Angular

I need to check if any of the "cuesData" have values or lengths greater than 0. However, in my current code, I can only evaluate the first array and not the rest. https://i.sstatic.net/bMpvg.jpg TS checkValues(values) { const result = Object.values ...

The Python Selenium is struggling to find the add to cart button on Amazon and Flipkart websites

I am a beginner in test automation and I am trying to create my first automated test case by searching for mobiles on the Flipkart website, clicking on a specific mobile, and adding it to the cart. However, I am running into an issue with the error messa ...

Having trouble sending keys to a text box with Selenium. Encountering a selenium.common.exceptions.TimeoutException: Message:

When attempting to input keys into the search bar text box using Selenium, I encounter this error: Traceback (most recent call last): File ".\test.py", line 19, in <module> WebDriverWait(driver, 20).until(EC.element_to_be_clickab ...

The issue with the antd Input component's onChange event not updating state correctly when using a list fetched from an axios get request in a React

Recently delving into React, I've dedicated the past week to honing my skills. My current project involves creating a straightforward application featuring a 'product create' form alongside a product list equipped with a search bar (utilizin ...

Maximizing Reusability: Implementing Redux Toolkit Reducers with TypeScript

Below is an example of a slice that I have: const authSlice = createSlice({ name: "auth", initialState: { ...initialUserInfo, ...initialBasicAsyncState, }, reducers: { setUser: (state, { payload }: PayloadAction<{ userObj: ...

How can we activate intellisense for a Vue component's template HTML?

Although I am still fairly new to Vue, I have a strong background in Typescript and Angular. Currently, I am embracing Typescript and utilizing the vue-class-component and vue-property-decorator libraries following the recommendations in the Vue documentat ...

The name 'Queue' cannot be located in Typescript, error code ts(2304)

I'm currently trying to create a private variable of type InnerItem, but I keep encountering the following error: Error: Cannot find name 'Queue'.ts(2304) private savedItems: Queue<InnerItem> = new Queue<InnerItem>(20); Could ...

Having trouble with the .d.ts module for images?

I'm relatively new to Typescript and the only thing that's giving me trouble is the tsconfig.json. My issue revolves around importing images (in Reactjs) and them not being found: client/app/Reports/View.tsx:11:30 - error TS2307: Cannot find mod ...

Inferring object types through direct values

This code example has a lot of detail: interface Coordinate { latitude: 40.7128; longitude: -74.0060; } const location: Coordinate = { latitude: 40.7128, longitude: -74.0060, }; // The inferred type would have been // { x: number; y: number; } I ...

Cannot execute example of type alias in Typescript

While delving into the Typescript documentation, I came across the concept of type alias and found an interesting example here. type DescribableFunction = { description: string; (someArg: number): boolean; }; function doSomething(fn: DescribableFunctio ...

What is GraphQl indicating when it informs me that I neglected to send arguments for the mutation

My GraphQL schema consists of various mutations and queries. I believe that validation of mutations should only occur when I send mutation { ... } to the graphql server. However, currently, the server is informing me that I have not sent arguments for all ...

After dismissing an alert, NUnit appears to lose its connection to Reflect.js

Currently, I am utilizing C# and the Selenium Webdriver in Visual Studio 2017 to automate various tests. However, I have encountered a hurdle with a test that fails to locate an element after dismissing an alert. While debugging the code, an error pops up ...