Skip to main content

Posts

WebdriverIO automation test give me this error Cannot read properties of undefined (reading 'baseUrl'

This is the console result: [chrome 97.0.4692.99 mac os x #0-0] Running: chrome (v97.0.4692.99) on mac os x [chrome 97.0.4692.99 mac os x #0-0] Session ID: 12a9eb48c2c5c3efd4a7edabad5a153c [chrome 97.0.4692.99 mac os x #0-0] [chrome 97.0.4692.99 mac os x #0-0] » /test/specs/gtb-ui.ts [chrome 97.0.4692.99 mac os x #0-0] /get-the-box [chrome 97.0.4692.99 mac os x #0-0] ✖ "before all" hook for /get-the-box [chrome 97.0.4692.99 mac os x #0-0] [chrome 97.0.4692.99 mac os x #0-0] 1 failing (75ms) [chrome 97.0.4692.99 mac os x #0-0] [chrome 97.0.4692.99 mac os x #0-0] 1) /get-the-box "before all" hook for /get-the-box [chrome 97.0.4692.99 mac os x #0-0] Cannot read properties of undefined (reading 'baseUrl') I don't know how to solve that one, I'm pretty new at this but if anyone have some tips that would be great! Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW

How to get adjacent col value in a div-table using js?

I have an html table, which is structured like this: <body> <div class="block div-table" id="sidebar-record-block"> <div class="div-table-row"> <div class="div-table-header">Sel</div> <div class="div-table-header">Color</div> <div class="div-table-header">Hex</div> </div> <div id="field-0000" class="div-table-row"> <input type="checkbox" class="div-table-td" name="checkBox" id="cbfield-0000"> <div class="div-table-td">yellow</div> <div class="div-table-td"></div> </div> <div id="field-0001" class="div-table-row"> <input type="checkbox" class="div-table-td" name="checkBox" id="cbfield-0001"> <div class="div-table-td">red</div> <

How to extract these texts using Selenium Python? [closed]

I have tried a lot to extract the information using all the options, but I wasn't getting the answer which I wanted. Like, I need the information from 1st dialogue (i.e Monica until the last one), but I'm getting entire texts on the webpage, and I'm not able to loop through each dialogue and format them into a CSV file. the webpage tried using finding element by xpath element by tag name (p) This is how I want my CSV file to look with each line separated by, with cast name. I'm new to Selenium. source https://stackoverflow.com/questions/70789156/how-to-extract-these-texts-using-selenium-python

Why function called by function name not working when function is created by assigning it to a variable? [duplicate]

// I created two function in JavaScript // **Function 1** function add(a, b) { return a + b; } // To call above function I use and it worked as expected add(2, 3); // **Function 2** let x = function mul(a, b) { return a * b; } // To call above function I use two ways x(2, 3); mul(2, 3); // This won't work. Why? Why the mul(2,3); throwing an error? mul(2,3) is the name of the function, it should be used to call the function. Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW

How to loop through a json file and change specific values based on specific criterias

I am trying to make a python script in which I can change a specific value based on a specific location inside a file for this example a json file specifically. The json file is about 100k long there are multiple areas specified with "name": "Box #14", "name": "Box #16", "name": "Box #17" and the list keeps going. For each name it comes an image field just below the name e.g. "image": ".png" , I want to edit that .png value to be based on a specific value depending on the name number. For example if "name": "Box #14 then "image": "13.png" and if "name": "Box #15 then "image": "14.png" and so on... What I got so far is: import re import sys i = 0 ++i PAT = re.compile('"image": ".png"') KEYWORDS_PATH = 'images.json' KEYWORDS = open(KEYWORDS_PATH).read().splitlines() names = ['"name&q

TypeError: this.cliEngineCtor is not a constructor

I'm running a react app using a yarn package manager. I'm getting the aforementioned ESLint error. I have tried the following to fix it: Deleted package-lock.json and node modules and installed yarn and ran yarn init Modified the eslint-plugin.js file to include the following at the top of the file: I used both of these at different times to no avail: this.CliEngineCtor = require(this.basicPath).CLIEngine; this.CliEngineCtor = require(this.basicPath).CLIEngineCtor; Pertinent package.json entry: { "name": "react-millionaire-quiz", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom": "^5.16.1", "@testing-library/react": "^12.1.2", "@testing-library/user-event": "^13.5.0", "react": "^17.0.2", "react-dom": "^17.0.2", "react-scripts": &qu

Bottom Up Search to Filter a Nested Menu Array

I have searched on here for bottom-up search examples and I understand how they are done, but I have a specific need here that I have been unable to solve. We have a menu system that I need to create a filter for. So for example if the menu is - Testing - Test - Something - Something Else - Test If I filter for "Test" I want 4 nodes back and everything else pruned out. The tricky part is that it can't remove the "Something" node in this case due to it having matching children that need to be accessed. My code works, but only for the top level items, due to the filter pass during the first recursion step removing anything that may have matching children but the parent doesn't match. private recursiveFilter(menuItems: MenuItem[], label: string): MenuItem[] { if (label === '') { this.menuItems = this.originalMenuItems; return this.menuItems; } else if (!menuItems) { return []; } return menuItems .filter((el) => el.label