Skipping the Typescript function for now

I'm facing an issue where the below function is getting skipped during debugging, regardless of the scenario. I'm at a loss as to why this is happening as nothing is being thrown out of the catch block. Upon debugging, I find myself immediately reaching the last line after the catch block. Any assistance would be greatly appreciated.

  public async Function(licence:string,stepDescription) {
    try{
        let count:number = await this.doctorsLicenceNumbers.count();
        let checked:boolean = false;
        let doctorRefernceFromWeb;
        for(let i=0; i < count; i++) {
            doctorRefernceFromWeb = await this.doctorsLicenceNumbers.get(i).getText(); 
            if (doctorRefernceFromWeb == licence) {
                checked=true;
                await this.doctorsReferncesCheckBoxes3.get(i).click();
            }
        };
        }
            
    }catch(e){
        console.log("function failed error is: " +e);
    }
}

Answer №1

After some trial and error, the solution to this problem came when I converted the objects from elementArrayFinder into an array of elementFinder. Appreciate all the help.

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

The ReactJS template with Typescript is throwing an error stating that the property useContext does not exist on type

After creating a react-app using yarn create react-app app-name --template typescript, I have the following code snippets to share: AuthProvider.tsx import { createContext, useState } from "react"; const AuthContext = createContext({ }); ex ...

Selenium with JavaScript: The Battle of Anonymous Functions and Named Functions

When working with Selenium JavaScript, the prevalent advice I come across online suggests that the most effective approach to handle the asynchronous behavior of JavaScript is by utilizing anonymous functions with .then() for locating/interacting with elem ...

Why isn't the constraint satisfied by this recursive map type in Typescript?

type CustomRecursiveMap< X extends Record<string, unknown>, Y extends Record<string, unknown> > = { [M in keyof X]: M extends keyof Y ? X[M] extends Record<string, unknown> ? Y[M] extends Record<st ...

Tips for effectively combining Selenium and Scrapy in your web scraping projects

Struggling to access Bloomberg for scraping the title and date, I turned to a headless browser to get the required data. Here's the code snippet using both Selenium and Scrapy: import scrapy from selenium import webdriver from selenium.webdriver.sup ...

Testing with Robot Framework and Selenium2Library on IE11 has proven to be quite unreliable and unstable

When running test cases on Chrome, FF or Edge, everything goes smoothly and you can even continue using the browser after the tests are conducted. However, when it comes to IE, running tests through a web driver causes the browser to become unstable. This ...

When I define a type in TypeScript, it displays "any" instead

Imagine a scenario where we have a basic abstract class that represents a piece in a board game such as chess or checkers. export abstract class Piece<Tags, Move, Position = Vector2> { public constructor(public position: Position, public tags = nul ...

Update the language setting on-the-fly in Angular 7 without the need to refresh the application

Is there a way to change the Locale_Id in my angular app during runtime without using window.location.reload() to update the locale? I need to implement a solution where I can switch locales dynamically without having to reload the entire application. Be ...

Displaying a TypeScript-enabled antd tree component in a React application does not show any information

I attempted to convert the Tree example from antd to utilize TypeScript, however, the child-render function does not seem to return anything. The commented row renders when I remove the comment. The RenderTreeNodes function is executed for each element in ...

Choosing Nested TypeScript Type Generics within an Array

I need help with extracting a specific subset of data from a GraphQL query response. type Maybe<T> = T | null ... export type DealFragmentFragment = { __typename: "Deal" } & Pick< Deal, "id" | "registeringStateEnum" | "status" | "offerS ...

Is it necessary to include compiled JavaScript files in the Git repository?

Just starting out with TypeScript and curious about best practices according to the community. For production compilation, I currently use the webpack loader. However, during testing, I find myself needing to run tsc && ava. This results in the cr ...

Having difficulty with a button in a Navbar using Python and Selenium

As a newcomer to Selenium, I am currently attempting to automate the login process for a specific site but have hit a roadblock with clicking on the drop-down button in the navigation bar. Below is my current code: from selenium import webdriver from sel ...

"An error has occurred during the ANT build, resulting in java.lang.NoClass

I encountered an issue related to the classpath during the run phase. The error message reads as follows: run: [java] java.lang.NoClassDefFoundError: org/openqa/selenium/WebDriver [java] at java.lang.Class.getDeclaredMethods0(Native Method) [ ...

Measuring the characters within an HTML element

Wondering if there's a way to calculate the number of letters in the inner text of an HTML element without including the inner elements' texts? I experimented with the ".getText()" method of "WebElements" using the Selenium library, but it inclu ...

What is the best way to execute multiple Protractor test suites simultaneously?

Exploring Protractor for the first time. My goal is to run multiple test suites in a sequence. I have a complex angular form with various scenarios, each with its expected results. I want to execute all tests with just one command. Initially, I tried enter ...

Using Threejs to create an elbow shape with specified beginning and ending radii

I'm a beginner in Threejs and I'm attempting to create an elbow shape along a curved path with varying begin_radius and end_radius, using the curve_radius and an angle. However, I haven't been successful in achieving the desired results. C ...

Is there an equivalent concept to Java's `Class<T>` in TypeScript which allows extracting the type of a class constructor?

I'm in need of a feature similar to the Class functionality in Java, but I've had no luck finding it. Class<T> is exactly what I require. I believe it could be named NewableFunction<T>. However, such an option does not exist. Using M ...

Access your LinkedIn account by using Selenium automation

As I embark on a small project to scrape LinkedIn data using Selenium, one of the initial challenges I encounter is that the login page does not behave the same when accessed with Selenium compared to manually through a browser. Manually loading the page ...

Having trouble grasping this concept in Typescript? Simply use `{onNext}` to call `this._subscribe` method

After reading an article about observables, I came across some code that puzzled me. I am struggling to comprehend the following lines -> return this._subscribe({ onNext: onNext, onError: onError || (() => {}), ...

What is the best way to inject a custom Angular service into a test in TypeScript without needing to mock it?

I have defined my modules and tests as shown below, but I encounter an issue when attempting to inject ContentBlocksService into the beforeEach(mock.inject((ContentBlocksService)... statement. It shows an error message saying Unknown provider ContentBlocks ...

Tips for using SendKeys in Selenium for my Website

I am currently working on automating a specific page. After navigating to the following link [Link], a prompt will appear. I have successfully managed to handle this prompt, however, when I click on the continue button within the iframe, the Home Page disp ...