Sunday, May 1, 2022

Recent Questions - Stack Overflow

Recent Questions - Stack Overflow

Recent Questions - Stack Overflow


Webpack shows warning twice

Posted: 01 May 2022 05:38 AM PDT

I have an ejected CRA and I recently upgraded Webpack to version 5, and now after using npm run start I get warning twice (attached), is there any option to show it only once?

Compiled with warnings.    src/app/apollo/apollo.ts    Line 15:7:   Unexpected console statement  no-console    Line 18:21:  Unexpected console statement  no-console    Search for the keywords to learn more about each warning.  To ignore, add // eslint-disable-next-line to the line before.    WARNING in src/app/apollo/apollo.ts    Line 15:7:   Unexpected console statement  no-console    Line 18:21:  Unexpected console statement  no-console    webpack compiled with 1 warning  No issues found.  

How to generate permanent Selenium Grid 4 url link/ export link to a global variable?

Posted: 01 May 2022 05:38 AM PDT

I want to run tests on a selenium grid network existing inside of containers. For that I need to pass the selenium hub url to the driver.

The problem is that the selenium hub url is always different. It used to be that the selenium grid had the same url from session to session, for example "https://localhost:4444/wd/hub", but now the url has the ip address part that keeps changing: http://100.00.0.0:4444, where 100.00.0.0 is the variable part.

How can I make the url stay the same from session to session? Or how to export the url into a varuable? Either solution would solve my problem.

The yml file I use to create selenium grid

version: '3.7'    services:    e2e:      build:        dockerfile: Dockerfile        context: .      command: bash run_test_page.sh        depends_on:        - 'selenium-hub'        - 'selenium-1'        - 'selenium-2'      selenium-1:      image: selenium/node-chrome:latest      shm_size: '2gb'      depends_on:        - selenium-hub      environment:        - SE_EVENT_BUS_HOST=selenium-hub        - SE_EVENT_BUS_PUBLISH_PORT=4442        - SE_EVENT_BUS_SUBSCRIBE_PORT=4443      selenium-2:      image: selenium/node-chrome:latest      shm_size: '2gb'      depends_on:        - selenium-hub      environment:        - SE_EVENT_BUS_HOST=selenium-hub        - SE_EVENT_BUS_PUBLISH_PORT=4442        - SE_EVENT_BUS_SUBSCRIBE_PORT=4443      selenium-hub:      image: selenium/hub:latest      expose:        - 4444  

The output from selenium hub

selenium-hub_1  | 2022-05-01 12:13:44,867 INFO Included extra file "/etc/supervisor/conf.d/selenium-grid-hub.conf" during parsing  selenium-hub_1  | 2022-05-01 12:13:44,871 INFO supervisord started with pid 7  selenium-hub_1  | 2022-05-01 12:13:45,874 INFO spawned: 'selenium-grid-hub' with pid 9  selenium-hub_1  | 12:13:46.589 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding  selenium-hub_1  | 2022-05-01 12:13:46,593 INFO success: selenium-grid-hub entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)  selenium-hub_1  | 12:13:46.598 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing  selenium-hub_1  | 12:13:47.162 INFO [BoundZmqEventBus.<init>] - XPUB binding to [binding to tcp://*:4442, advertising as tcp://100.00.0.0:4442], XSUB binding to [binding to tcp://*:4443, advertising as tcp://100.00.0.0:4443]  selenium-hub_1  | 12:13:47.377 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://100.00.0.0:4442 and tcp://100.00.0.0:4443  selenium-hub_1  | 12:13:47.571 INFO [UnboundZmqEventBus.<init>] - Sockets created  selenium-hub_1  | 12:13:48.573 INFO [UnboundZmqEventBus.<init>] - Event bus ready  selenium-hub_1  | 12:13:52.113 INFO [Hub.execute] - Started Selenium Hub 4.1.4 (revision 535d840ee2): http://100.00.0.0:4444  selenium-hub_1  | 12:13:53.888 INFO [Node.<init>] - Binding additional locator mechanisms: id, relative, name  selenium-hub_1  | 12:13:55.296 INFO [GridModel.setAvailability] - Switching Node 79566d8f-468c-4a70-8af4-c969aa9bbd21 (uri: http://100.00.0.0:5555) from DOWN to UP  selenium-hub_1  | 12:13:55.299 INFO [LocalDistributor.add] - Added node 79566d8f-468c-4a70-8af4-c969aa9bbd21 at http://100.00.0.0:5555. Health check every 120s  selenium-hub_1  | 12:13:55.331 INFO [Node.<init>] - Binding additional locator mechanisms: id, relative, name  selenium-hub_1  | 12:13:55.430 INFO [LocalDistributor.newSession] - Session request received by the Distributor:   selenium-hub_1  |  [Capabilities {browserName: chrome, goog:chromeOptions: {args: [--window-size=1920,1080, --headless], extensions: []}, pageLoadStrategy: normal}]  selenium-hub_1  | 12:13:55.742 INFO [GridModel.setAvailability] - Switching Node b43fc442-971c-4ef3-be4a-4c6a439ca386 (uri: http://100.00.0.0:5555) from DOWN to UP  selenium-hub_1  | 12:13:55.746 INFO [LocalDistributor.add] - Added node b43fc442-971c-4ef3-be4a-4c6a439ca386 at http://100.00.0.0:5555. Health check every 120s  selenium-hub_1  | 12:13:55.761 INFO [LocalDistributor.newSession] - Session request received by the Distributor:   selenium-hub_1  |  [Capabilities {browserName: chrome, goog:chromeOptions: {args: [--window-size=1920,1080, --headless], extensions: []}, pageLoadStrategy: normal}]  

Load `.env` file in Heroku when deploying Flask app [duplicate]

Posted: 01 May 2022 05:37 AM PDT

I wish to deploy a small experimental Flask app in Heroku. The app expects to find some environment variables which I have stored in a .env file. How an I load them in the container Heroku creates straight from the .env file?

Why the DynamicMethod cant work in ExcelDna

Posted: 01 May 2022 05:37 AM PDT

I want to create user-defined formula in Excel addin by ExcelDna ,and before I get the api response I don't know the name of the formula.All of the formula is just like that(It's worked good):

public static object GETROOT(object Param1, object Param2)          {              GetApiResult("001659ca6e3ed001d9a9be59d903a15c", new object[]              {                  Param1,                  Param2              });              return "LOADING";          }  

The GetApiResult is an asynchronous function to get some data from server,and the fist parameter is a string.Based on that limits,I tried to create a DynamicMethod to reach my goal,this is my code:

public static void UDFCreate(Detail detail)          {              #region               string APIID = detail.apiIndDetail.id; //               string name = detail.apiIndDetail.formula;//               string description = detail.apiIndDetail.name;//              List<string> paramList = new List<string>();//               var inputList = detail.apiIndInputs; //               foreach (var input in inputList)              {                  paramList.Add(input.code);              }              Type[] types = new Type[paramList.Count];              foreach (string param in paramList)              {                  int index = paramList.IndexOf(param);                  types[index] = typeof(object);              }              

No comments:

Post a Comment