finallyThe assertion error in webdriverjs is concealed by the thenFinally() function

I'm facing an issue in my test case:

  1. It enters a specific URL
  2. Logs in
  3. Validates something
  4. Logs out

If the validation fails, the logout step is skipped.

To handle this, I tried using thenFinally(), but it caused another problem - it conceals any assertion errors and shows the test as passing even when it's actually failing.

I would appreciate it if someone could assist me in figuring out what I'm doing incorrectly or suggest a possible workaround. Thank you!

Answer №1

section, it appears that utilizing the then() method would be more appropriate than using thenFinally(). You can pass a callback function to handle signing out and another callback function to handle error assertions.
async().then( 
  function(success) {
    signout();
  }, 
  function(error) {
    console.log(error);
  });

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

Trouble receiving a reply from the Angular controller

I'm a newcomer to AngularJS and I'm currently working on integrating AngularJS into one of my existing applications. Below is the provided HTML and JavaScript code: <!doctype html> <html ng-app="ldlApp"> <head> <script src= ...

Is the bottom of the page getting partially hidden when there are more than two rows of elements?

This is a movie review application. When the screen size is on PC and mobile devices, there seems to be an issue where the movie review gets cut off from the 3rd row onwards. This is visible in the provided image, where only the buttons are partially cut o ...

The JSON element is failing to render

I recently started using ejs and encountered an issue with my input tag: <input class="form-control" id="inputName" type="text" <% { %>value='<%= JSON.stringify(result.firstname) %>'<% } %> When I try to print the data, it ...

Is it possible to disable other options when a checkbox is checked, but enable them all when unchecked using

I am trying to create a group of checkbox buttons where if one is checked, the others should be disabled. When the checked checkbox is unchecked, all checkboxes should be enabled. However, my current code is experiencing issues where all checkboxes become ...

Tips for concealing the delete button within the main content area and displaying it in the subsequent "add" pop-up window upon clicking the "add" button in Angular

I have a card with add and delete buttons. I want only the add button to show initially, and when clicked, a new card should open with both add and delete buttons. Everything is working as expected except I can't figure out how to hide the delete butt ...

What steps can you take to ensure an element is visible during the web scraping process

I have been working on extracting information from the Fortune 100 Best Companies to Work For link. My approach involves going through each company and pulling out relevant data. Here is the snippet of the code I am using: import datetime import pandas a ...

How can dynamically added data be retained in a table after reloading the page?

I have a piece of JavaScript code that is functioning properly, but the dynamically inserted data in the table gets lost after reloading the page. I am also implementing server-side validation and need to ensure that the dynamically added data persists e ...

Trigger a JavaScript function from ASP.NET code-behind

Here is a JavaScript function I've created: function returnToParent() { var oArg = new Object(); var oWnd = GetRadWindow(); oArg.ReturnValue = "Submit"; oWnd.close(oArg); } This is how I call the func ...

Unable to update array with HTTP Put request: No document was found that matches the criteria. The method 'send' is not available

I'm facing some challenges when trying to execute HTTP Put requests within an array using AngularJS and ExpressJS. The problem arises when I make the first HTTP Put call, everything works fine. However, on subsequent attempts, it fails to work. Below ...

Submitting a form using jQuery and processing the response

Can a form be submitted using jQuery without utilizing json, ajax, or other methods for handling the result? For example: <form id="loginform"> //some input fields and a submit button. </form> And then with jQuery: $("#loginform").sub ...

Retrieve the information from a website and display it on the current webpage using an ajax request

Is there a way to insert parsed HTML content into my webpage using just a link from another page? I'm attempting to use an AJAX call, but I keep receiving an error. Below is the code I've written, and the browser doesn't seem to be the issue ...

Discovering latitude and longitude coordinates from a map URL, then enhancing dynamism by utilizing the coordinates as parameters

Hello, I am currently learning Vue.js and have encountered a challenge with embedding Google Maps URLs. Despite my extensive research on Google, I have not been able to find the solution I need. Here is an example of the URL I am working with: "https: ...

Acquiring an icon of a program using its handle

I am looking for a way to extract a program's icon from its handle, which I acquired using User32.dll with EnumWindow/FindWindow. While I am aware of ExtractAssociatedIcon, it seems to work from a file instead of a handle. My question is how can I con ...

Determine if a file input is linked in React.js Material UI

Currently, I am working with a Material UI <TextField /> component that has a type=file prop to allow file attachments. My goal is to trigger an event when a file is attached to this TextField. However, my search results only provided JQuery soluti ...

Show an error message in a popup window, following a validation error in Laravel

I am facing an issue with displaying error messages in the update modal form. I am using Laravel request for validation and AJAX to submit the form inside a modal. My goal is to show the error message for each field that is inputted incorrectly. However, i ...

Discovering the title of an empty Div within a Table Row using Selenium in Java

There is a constantly changing Div class and title within this Table Row. I am trying to identify the specific div when it displays certain text. The code snippet is as follows: <tr class="this_row"> <td class="something"></td> <td&g ...

How can we delete a specific word from a string if it is found in an

Facing a seemingly simple problem that's proving tricky to solve. I have an array of product names and a sentence. The goal is to remove any product names from the sentence if they appear in it. const products = ["premium t-shirt", "t-shirt", "swea ...

Revamping this snippet - JavaScript with NodeJs

Currently working on a basic CRUD application, encountering an issue with obtaining the auto-incrementing value for the latest account in MongoDB. To provide more context, I've included the snippet below to achieve the following: 1) Conduct validati ...

ways to change date format in a React.js application using JavaScript

<b>Choose Date and Time</b><br/> <DateTimeField onChange={this.clockevent} format={"x"}/> clockevent=(newDate)=>{ var dateVal ="/Date("+newDate+")/"; var date = new Date(parseFloat(dateVal.substr(6))); console.log( ...

Cached images do not trigger the OnLoad event

Is there a way to monitor the load event of my images? Here's my current approach. export const Picture: FC<PictureProps> = ({ src, imgCls, picCls, lazy, alt: initialAlt, onLoad, onClick, style }) => { const alt = useMemo(() => initial ...