Personalize JSON Reporter to Display Captured Information - WebdriverIO

I'm currently in the process of scraping data from an android app using WDIO and APPIUM. After successfully storing the scraped data in an array, I now aim to automatically output this array data to a .json file, rather than manually copying and pasting it from the console. Despite coming across WDIO's JSON reporter, the lack of clear information on how to customize the test results has left me struggling. I attempted returning the array within my afterTest hooks, but to no avail.

reporters: [
  'dot',
  ['json',{
      outputDir: './Results'
  }]
],

If anyone could provide some assistance, that would be greatly appreciated!

Answer №1

Instead of personalizing the reporter, I opted to utilize the fs module in node.js to store my scraped data following a successful test. Feel free to save it in any preferred format, just remember to convert the scraped data to the desired format before saving. Much appreciated.

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

Steps for storing API information in localStorage:1. Retrieve the API data

My app is running sluggish due to the excessive API calls for information retrieval. To optimize performance, I want to create a unified object containing all the data that can be shared across pages and accessed from localStorage, thus enhancing the app ...

Activate the saturation toggle when a key is pressed in JavaScript

I am trying to modify a script that currently toggles the value of a variable when a key is pressed and then lifted. Instead of changing the variable value, I would like to adjust the saturation of the screen based on key presses and releases. How can I ac ...

Oppose the idea of splitting KeyValue Pair collections into individual objects

I am currently faced with a challenge where I must convert any object into a key-value pair format. So far, my method has been successful for simple classes as well as those that contain other classes within them. For example, consider the following: pu ...

Is IPv6 like a JavaScript string in any way?

Introduction In the era of IPv4, life was simpler as IPv4 addresses could easily be converted into 32-bit integers for various calculations. However, with the introduction of IPv6, things have become more complicated due to the lack of native support for ...

Is it acceptable to use the return value of false in order to resolve the ESLint consistent-return error when working with asynchronous functions

When working with ExpressJS, I encountered a situation where I needed to execute and adhere to ESLint rules in my code. One particular rule that caused an issue is "consistent-return", which flagged the following code snippet: function getUsers( req, res, ...

Exploring the use of Shadow DOM in ContentEditable for securing text segments

I have recently been working on creating a basic text editor using ContentEditable. The main requirement for the application is to allow users to insert blocks of text that are protected from typical editing actions. These protected text blocks should not ...

Utilizing JQueryMobile, JSON, and transferring data to a fresh webpage

Hi there, hope everyone is doing well and having a great time coding! I have a question regarding passing a URL rel to a new page for future use. Let me explain with an example instead of going on and on. Imagine you are on page "A" and you have a link t ...

An error popped up out of the blue while attempting to execute Webpack

Looking to deploy my React website on IIS but encountering an error when running npm run build:prod. The error message states: index.js Line 1: Unexpected reserved word. You may need an appropriate loader to handle this file type. Below is the snippet fro ...

Navigating variable columns and rows in a static column table

Here is a preview of how my table will appear: <table> <thead> <tr> <th>Name</th> <th>Week 1</th> <th>Week 2</th> <th>Week 3</th> </tr> < ...

Having trouble getting a local npm installation to work from a specific file path?

After following the instructions from this helpful link to install an npm package through a file path, I encountered an error when attempting to use it: Cannot find module '<module_name>' or its corresponding type declaration Are there an ...

Troubleshooting Problem: Incompatibility with Angular 1 and Angular 2 Hybrid Application causing Display Issue with Components

In my development work, I have created a unique hybrid application that combines Angular 1 and Angular 2 functionalities. This hybrid setup was achieved by following the guidelines provided in two helpful resources: Upgrading from AngularJS and Migrating A ...

Display a div element on the page after 10 seconds of loading

Recently, I managed to get this script working successfully where it fades out within 20 seconds. However, I am looking to modify it so that it takes only 10 seconds to display after the page loads. Any suggestions on what I should change in the code? jQu ...

The switch switches on yet another switch

Greetings everyone, Currently, I am in the midst of my exam project and creating a mobile menu. The functionality is there, but unfortunately, when closing the menu, it also triggers the search toggle which displays an unwanted div, becoming quite botherso ...

Troubleshooting issues with AngularJS's minDate functionality

I have been trying to set the minDate for the datepicker to today, following the example on the angularJS bootstrap site. However, it seems like something is not working correctly. There are no console errors showing up, but it appears that the minDate is ...

What counterpart in JavaScript resembles the .NET Standard Class Library?

As someone transitioning from a background in .NET to learning Vue.js, I'm curious about the best way to create classes that handle business logic for me. Specifically, I want to be able to fetch information from an API, format it as needed and easily ...

Guide on transforming simple values into a JSON format with a schema that adjusts dynamically

I have a list of data values stored in a CSV file, along with a JSON schema that has the ability to change during runtime. My goal is to generate a JSON output based on the schema and populate it with the corresponding values from the CSV. For example, le ...

Arranging an array in alphabetical order, with some special cases taken into consideration

Below is a breakdown of the array structure: [{ name: "Mobile Uploads" }, { name: "Profile Pictures" }, { name: "Reports" }, { name: "Instagram Photos" }, { name: "Facebook" }, { name: "My Account" }, { name: "Twi ...

The functionality of Angular 2's AsyncPipe seems to be limited when working with an Observable

Encountering an Error: EXCEPTION: Unable to find a support object '[object Object]' in [files | async in Images@1:9] Here's the relevant part of the code snippet: <img *ngFor="#file of files | async" [src]="file.path"> Shown is the ...

Attempting to manipulate arrays by using the json_query method

I'm experiencing difficulties with using the json_query function to filter arrays based on a specific key value. When providing the direct path, this is the API result that is displayed: ok: [localhost] => { "msg": [ { ...

display the information stored within the sports attribute using React

I am attempting to display the values stored in the sports property. So, I inserted a console log within the sports property. However, an error is being thrown: Syntax error: C:/codebase/src/containers/sports.js: Unexpected token, expec ...