How to evaluate expression in js without showing anything on client end

I have a static REPL that I am working on, and I have code that I need to sort through, evaling it line by line. If there are errors, I tell the client, but if there are none, I eval the whole code alltogether. During the line-by-line test runs, how do I run them so that the client won’t see window.alerts, any changes in the HTML, any console logs, but still get the end result of each line (the values of variables changed in the line). How can I do this?

Component is re-rendered but submitted props go blank after re-render

I’m facing the following difficulty:

I’m calling a component(ListView) inside another component, passing some properties.

The first time the component is rendered, it goes through the Created hook, where I get some information to pass in the ListView’s props.

The second time I render it, it’s not calling created, so the data goes empty to the ListView.

I need it to work this way, because I’m building my dynamic menu, so when I change the menu, it has to go through the component and change its properties.

How can I proceed?

Attempts:
1 – Using :key
2 – forceUpdate

both unsuccessful

(Sorry, my English is bad)

Devices.vue

  <div >
    <ListView :key='$route.name'
        :domainName="domainName" 
        :metadataName="metadataName"
        :entityList="entityList"
        :metadataList="metadataList"
        :showBooleanAsFlag="true"
        :showButtonAddEntity="true"
        
      />

  </div>
</template>

<script>
import restService from "../../services/restService"
import ListView from "../../components/ListView/ListView.vue";
import {getCapitalizeFirstLetter} from '@core/utils/utils'


export default {
  components: {
    ListView,
  },
  data() {
    return {
      metadataName: '',
      domainName: '',
      metadataList: [],
      allMetadata: [],
      entityList: [],
    };
  },
   methods: {
     print(data){
       console.log('PRINT ', data)
       
     },
     async loadSettings(){
       
        var arrayOfRoute = this.$route.name.split('-');
    
        this.domainName = getCapitalizeFirstLetter(arrayOfRoute[1])
        this.metadataName = getCapitalizeFirstLetter(arrayOfRoute[2])
        
        await restService.getMetadata(this.domainName, this.metadataName ).then((response) => {
          this.metadataList = response.data.result.metadata;
        });

        await restService.getEntity(this.domainName, this.metadataName).then((response) => {
          this.entityList = response.data.result.entity;
        });
     }
  },
  
  watch:{
    async '$route' (to, from){
      console.log('WATCH!!!')
      this.loadSettings();
    }
  },
  created(){
    console.log('CREATED!!!')
    this.loadSettings();
  }

};
</script>

<style lang="scss">
</style>

React bootstrap hook onClick event function being struck-called by other event function

I’m try to putting an onClick event in a <Row> tag to triggering OffCanvas component when my state value is true. The issue is I cant close the canvas and I’ve found a weird behavior which I cant understand, it’s seems like my first function for triggering the canvas always being called right after my close canvas function.

Here is my code sample:

import React, {useState} from 'react'
import "./index.scss"
import {Row, Col} from 'react-bootstrap';
import InspectSideDrawer from './InspectSideDrawer';

function InspectTransactionCard() {

    const [inspectCanvasShow, setInspectCanvasShow] = useState(false);
    
    const showCanvas = () => {
        console.log("Activating showCanvas...")
        setInspectCanvasShow(true);
    }    

    const closeInspectCanvas = (str) => {  
        console.log("Triggering close canvas...")
        setInspectCanvasShow(false)
        console.log("Triggering close canvas done")
    }    
    
    console.log("Currently canvas shows status is: " , inspectCanvasShow)


  return (
    <Row 
        className="mx-0 my-3 p-3 cst-inspect-transaction-card"
        onClick={()=>showCanvas()}
    >
        <Col className="px-0 d-flex flex-column justify-content-between">
            <small>
                <h6 className="">#NAS9DU239</h6>
            </small>
            <small className="d-flex align-items-center text-secondary">
                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="gray" className="bi bi-calendar" viewBox="0 0 16 16">
                    <path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"/>
                </svg>
                <span className="mx-1">10 May 2022</span>
            </small>
        </Col>
        <Col className="px-0 d-flex flex-column justify-content-between">
            <div className="text-end">
                <h6>Status:
                    <span className="cst-text-highlight-blue"> Checking</span>
                </h6>

            </div>
            <div className="text-end text-secondary">
                <small>Po No:
                    <span> 01229527071243248</span>
                </small>
            </div>
        </Col>

        <InspectSideDrawer
            inspectCanvasShow={inspectCanvasShow}
            closeInspectCanvas={closeInspectCanvas}
        />

    </Row>
  )
}

export default InspectTransactionCard;

And Here is my OffCanvas component:

import React from 'react'
import "./index.scss"
import {Row, Col, Offcanvas, Button} from 'react-bootstrap'

function InspectSideDrawer({inspectCanvasShow, closeInspectCanvas, setInspectCanvasShow}) {

  return (
    <Offcanvas className="cst-side-drawer" placement='end' show={inspectCanvasShow} onHide={closeInspectCanvas}>  
        <Offcanvas.Header closeButton>  
        <Offcanvas.Title>Inspection Detail</Offcanvas.Title>  
        </Offcanvas.Header>  
        <Offcanvas.Body>  
        </Offcanvas.Body>  
    </Offcanvas>  
  )
}

export default InspectSideDrawer;

For more further demonstration, I have provided a screenshot below:

first_screenshot
As you can see in the first screenshot , the canvas status default value is ‘false’ and this is correct.

second_screenshot In second screenshot, I have trigger the showCanvas function and the canvas works normally as long as the canvas status, everything seems fine.

third_screenshot In third screenshot, I want to close the canvas by clicking the X button which will triggering closeInspectCanvas function. However, as you can see, the showCanvas function has being called back right after my closeInspectCanvas function, it cause my canvas status value back to true and the canvas cannot be closed, I have no idea in this part.

The thing I’ve encounter is, it’s all work normally as I’m expected if I put the onClick event in <Button> tags, but not with other tags. Anyway, I have to achieve this kind of UI in my project and I need your help.

Jest mock is entering function logic instead of returning rejected promise

The Problem

What I’m trying to do is test that the error is caught and returned with the correct status code when a use case function returns a rejected promise.

The problem I’m having is that instead of a rejected promise, i just get this error instead of the mock function just returning a rejected promise.

This is the error that I’m getting:
TypeError: Cannot read properties of undefined (reading 'then')

The code

Inside a test suite I have this setup:

const container = new Container();

describe('Controller Error Tests', () => {
     let reportController: ReportController;
     
     let generateReportUseCase: IGenerateReportUseCase = mock<IGenerateReportUseCase>();

     container.bind<ReportServiceLocator>(TYPES.ReportServiceLocator).to(ReportServiceLocator);
     
     beforeAll(async () => {
        jest.clearAllMocks();
        cleanUpMetadata();
        dotenv.config();
        reportController = new ReportController(container.get<ReportServiceLocator>(Symbol.for("ReportServiceLocator")));
    });

     it('User held shares report use case throws error', async () => {
        let requestObj = httpMocks.createRequest({
            cookies: {
                token: jwt.sign({ id: 'test' }, process.env.JWT_SECRET_KEY!),
            },
            query: {
                report_type: 'CSV'
            }
        });

        let responseObj = httpMocks.createResponse();

        mock(generateReportUseCase).usersHeldShares.mockRejectedValue(new Error('Could not generate report'));

        await reportController.userHeldShares(requestObj, responseObj);
        expect(responseObj.statusCode).toEqual(500);
    })
})

reportController.userHeldShares is an inversify controller that looks like this:

@httpGet('/held-shares')
    public async userHeldShares(@request() req: express.Request, @response() res: express.Response){
        let jwtSecretKey = process.env.JWT_SECRET_KEY;
        let ascending: boolean = req.query.ascending === "false" ? false : true;
        let report_type: string = String(req.query.reportformat);
        let cookieData = await <IUserDto>jwt.verify(req.cookies.token, jwtSecretKey!);
            
        if(!cookieData.id){
            return res.status(401).json({error: 'User not authorised'});
        }
        
        return await this.generateReportUseCase.usersHeldShares(cookieData.id!, ascending, report_type)
            .then((userDto: IUserDto) => {
                res.status(200).json(userDto)
            })
            .catch((err: Error) => {
                res.status(500).json(err);
            });
    }

Here is what the first few lines of generateReportUseCase.usersHeldShares looks like, which is where the error comes from:

usersHeldShares(user_id: string, ascending: boolean, report_type: string): Promise<IUserDto> {
        return new Promise(async (resolve, reject) => {
            this.tradeReadOnlyRepository.fetch({user_id: user_id}, false)
            .then(async trades => {

What I am expecting

When it hits the line return await this.generateReportUseCase.usersHeldShares(cookieData.id!, ascending, report_type) in the inversify controller it just returns a rejected promise without entering the logic of the actual function.

How to generate string permutations?

Need help with permutations of a string. I want do generate all permutations add them to string by separate each result with ‘;’ :

let input = 'abc'
let answer = ''
const perm = function(string,p="") {
  let permutations=""
  if (string.length === p.length) {
    answer += p+';'
    return answer
  }

  for (let i = 0; i < string.length; i++) {
    const currentChar = string[i]
    let remainingChars = string.slice(0, i) + string.slice(i + 1)

      permutations = currentChar + remainingChars
      perm(string,permutations)
  }
  return permutations
}

perm(input)
console.log(answer)

this should produce: ‘abc;acb;bac;bca;cab;cba‘

Also would appreciate if you can give any advice on how to catch with recursions it’s really difficult for me to think this way :(.
Thank you

Should transaction#isCompleted be used before Transaction#rollback in knex?

There is Knex.Transaction.isCompleted.
However, it’s not clear what’s the purpose of it.
Should it be used before the Knex.Transaction.rollback?
F.e., is it sufficient to “just rollback”:

const transaction = await knex.transaction();
try {
    await knex('users').insert({'name': 'John'});
} catch (error) {
    await transaction.rollback();
}

or it should be checked for completion:

const transaction = await knex.transaction();
try {
    await knex('users').insert({'name': 'John'});
} catch (error) {
    if (!transaction.isCompleted()) {
        await transaction.rollback();
    }
}

?

The former looks better API-wise, but is it “robust enough”?

Also would be great if someone provides some examples when Knex.Transaction.isCompleted might be useful.

how to show the field name along with the value in angular13

hi i am working on angular13, here i have an advance search so when i add values in the advance search popup and perform save i am able to see the value as result in tag, but along with value i need the field name.
for example, if i have typed "demo agency" under "Agency Name field as a value", i must get "your search keyword is "demo agency" in "Agency Name". i am able to fetch demo agency but getting struck to fetch "Agency Name" as field name and it can contain all the input values and field names, so its like user can add any values to particular inputs for performing search. i need to show the second value same as the field name instead of key and value.

DEMO

HTML:

  <div>
    <button
      type="button"
      class="btn btn-outline-secondary btn-sm rounded-pill mr-1"
      [hidden]="!item.value"
      *ngFor="let item of advanceSearch | keyvalue"
    >
      {{ item.value }} in {{item.key}}
      <i class="fas fa-times-circle" (click)="remove(item.key)">close</i>
    </button>
  </div>

TS:

 private advanceSearchModel() {
    this.advanceSearch = {
      agentCode: '',
      groupAgent: '',
      agentName: '',
      dbaname: '',
      agentContact: '',
      agentZip: '',
      agentPhone: '',
      agentEmail: '',
      taxId: '',
      oldAgentNumber: '',
      agentType: '',
      agentCounty: '',
      agentAddress: '',
      farmBureauCode: '',
      agentDistrict: '',
      active: false,
      agentCity: '',
      agentState: '',
    };
  }

Unhandled promise rejection: TypeError: Network request failed when using fetch on ReactNative/Node,js/Expo

I made a very simple backend application using Node.js and Expo. If I run the backend on my work computer, I get the responses with no issues (I’m using REST Client on vscode for testing). But when I try to run the React Native Android app from my phone using the Expo app with Tunnel Connection, I get the following error:

[Unhandled promise rejection: TypeError: Network request failed]
at node_moduleswhatwg-fetchdistfetch.umd.js:535:17 in setTimeout$argument_0
at node_modulesreact-nativeLibrariesCoreTimersJSTimers.js:214:12 in _allocateCallback$argument_0
at node_modulesreact-nativeLibrariesCoreTimersJSTimers.js:112:14 in _callTimer
at node_modulesreact-nativeLibrariesCoreTimersJSTimers.js:357:16 in callTimers
at node_modulesreact-nativeLibrariesBatchedBridgeMessageQueue.js:417:4 in __callFunction
at node_modulesreact-nativeLibrariesBatchedBridgeMessageQueue.js:114:6 in __guard$argument_0
at node_modulesreact-nativeLibrariesBatchedBridgeMessageQueue.js:368:10 in __guard
at node_modulesreact-nativeLibrariesBatchedBridgeMessageQueue.js:113:4 in callFunctionReturnFlushedQueue

This is my app.js for the backend:

import express from 'express';
import cors from 'cors';
import morgan from 'morgan';

import swaggerJSDoc from 'swagger-jsdoc';
import swaggerUI from 'swagger-ui-express';
import { options } from './swaggerOptions';
const specs = swaggerJSDoc(options);

import tasksRoutes from './routes/tasks';

const app = express();//This is my app using express, which will listen to the port 3000

app.use(cors());
app.use(morgan('dev'));
app.use(express.json());

app.use(tasksRoutes);

app.use('/docs', swaggerUI.serve, swaggerUI.setup(specs));

export default app;

index.js:

import app from "./app";

app.listen(3000, '192.168.6.180');//I was using localhost, but changed to my ip address.
console.log('Server on port 3000');

routes/tasks.js:

import {Router} from 'express';
import {deleteTask, getTask, getTaskCount, getTasks, saveTask, updateTask} from '../controllers/tasks';

const router = Router();

router.get('/tasks', getTasks);
//More calls...

export default router;

controllers/tasks.js:

import {connect} from '../database';

export const getTasks = async (req, res) => {
    const connection = await connect();
    const[rows] = await connection.query('SELECT * FROM tasks');
    res.json(rows);
};
//More functions...

And this is my React Native component where I call the backend:

import { View, Text } from 'react-native'
import React, { useEffect } from 'react'

const HomeScreen = () => {

  const loadTasks = async () => {

    const res = await fetch('http://192.168.6.180:3000/tasks');
    const data = await res.json();
    console.log(data);

  }

  useEffect(() => {

    loadTasks();

  }, [])

  return (
    <View>
      <Text>Home Screen</Text>
    </View>
  )
}

export default HomeScreen

The page loads on my phone, but I can’t get the response. I’m testing this on my work. My computer is connected directly by ethernet, and my phone is using wifi to connect to a ‘guests’ network. That’s why I’m using Tunnel connection on Expo instead of LAN.

How to add text in JavaScript (Shopify Lite)

I would like to add the text “Quantity” above the quantity picker and maybe some quantity arrows so you can click how much you want instead of typing it in.

Here is the code.

<style>
  .center{
    margin: auto;
  width: 60%;

  padding: 10px;
  background-color:blue;

  }
  
  @media only screen and (max-width: 600px) {
  .center {
    background-color: purple;
      margin: auto;
  width: 60%;

  padding: 10px;

  }
}
  </style>

<div class="center "id='HIDDEN'></div>
<script type="text/javascript">
/*<![CDATA[*/
(function () {
  var scriptURL = 'https://sdks.shopifycdn.com/buy-button/latest/buy-button-storefront.min.js';
  if (window.ShopifyBuy) {
    if (window.ShopifyBuy.UI) {
      ShopifyBuyInit();
    } else {
      loadScript();
    }
  } else {
    loadScript();
  }
  function loadScript() {
    var script = document.createElement('script');
    script.async = true;
    script.src = scriptURL;
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(script);
    script.onload = ShopifyBuyInit;
  }
  function ShopifyBuyInit() {
    var client = ShopifyBuy.buildClient({
      domain: 'HIDDEN',
      storefrontAccessToken: 'HIDDEN',
    });
    ShopifyBuy.UI.onReady(client).then(function (ui) {
      ui.createComponent('product', {
        id: '6907387281545',
        node: document.getElementById('HIDDEN'),
        moneyFormat: '%24%7B%7Bamount%7D%7D',
        options: {
  "product": {
    "styles": {
      "product": {
        "@media (min-width: 601px)": {
          "max-width": "calc(25% - 20px)",
          "margin-left": "40px",
          "margin-bottom": "50px"
        }
      },
      "title": {
        "font-family": "Roboto, sans-serif",
        "font-weight": "normal",
        "color": "#000000"
      },
      "button": {
        "font-family": "Roboto, sans-serif",
        "font-weight": "bold",
        ":hover": {
          "background-color": "#000000"
        },
        "background-color": "#000000",
        ":focus": {
          "background-color": "#000000"
        }
      },
      "price": {
        "font-family": "Roboto, sans-serif",
        "color": "#353030"
      },
      "compareAt": {
        "font-family": "Roboto, sans-serif",
        "color": "red"
      },
      "unitPrice": {
        "font-family": "Roboto, sans-serif",
        "color": "#353030"
      },
      "description": {
        "font-family": "Roboto, sans-serif"
      }
    },
    "contents": {
      "img": false,
      "button": false,
      "buttonWithQuantity": true,
      "title": false,
      "price": false
    },
    "text": {
      "button": "Add to cart"
    },
    "googleFonts": [
      "Roboto"
    ]
  },
  "productSet": {
    "styles": {
      "products": {
        "@media (min-width: 601px)": {
          "margin-left": "20px"
        }
      }
    }
  },
  "modalProduct": {
    "contents": {
      "img": false,
      "imgWithCarousel": true,
      "button": false,
      "buttonWithQuantity": true
    },
    "styles": {
      "product": {
        "@media (min-width: 601px)": {
          "max-width": "100%",
          "margin-left": "100px",
          "margin-bottom": "0px"
        }
      },
      "button": {
        "font-family": "Roboto, sans-serif",
        "font-weight": "bold",
        ":hover": {
          "background-color": "#000000"
        },
        "background-color": "#000000",
        ":focus": {
          "background-color": "#000000"
        }
      },
      "title": {
        "font-family": "Helvetica Neue, sans-serif",
        "font-weight": "bold",
        "font-size": "26px",
        "color": "#4c4c4c"
      },
      "price": {
        "font-family": "Helvetica Neue, sans-serif",
        "font-weight": "normal",
        "font-size": "18px",
        "color": "#4c4c4c"
      },
      "compareAt": {
        "font-family": "Helvetica Neue, sans-serif",
        "font-weight": "normal",
        "font-size": "15.299999999999999px",
        "color": "#4c4c4c"
      },
      "unitPrice": {
        "font-family": "Helvetica Neue, sans-serif",
        "font-weight": "normal",
        "font-size": "15.299999999999999px",
        "color": "#4c4c4c"
      },
      "description": {
        "font-family": "Helvetica Neue, sans-serif",
        "font-weight": "normal",
        "font-size": "14px",
        "color": "#4c4c4c"
      }
    },
    "googleFonts": [
      "Roboto"
    ],
    "text": {
      "button": "Add to cart"
    }
  },
  "option": {
    "styles": {
      "label": {
        "font-family": "Roboto, sans-serif",
        "color": "#000000"
      },
      "select": {
        "font-family": "Roboto, sans-serif"
      }
    },
    "googleFonts": [
      "Roboto"
    ]
  },
  "cart": {
    "styles": {
      "button": {
        "font-family": "Roboto, sans-serif",
        "font-weight": "bold",
        ":hover": {
          "background-color": "#000000"
        },
        "background-color": "#000000",
        ":focus": {
          "background-color": "#000000"
        }
      },
      "title": {
        "color": "#000000"
      },
      "header": {
        "color": "#000000"
      },
      "lineItems": {
        "color": "#000000"
      },
      "subtotalText": {
        "color": "#000000"
      },
      "subtotal": {
        "color": "#000000"
      },
      "notice": {
        "color": "#000000"
      },
      "currency": {
        "color": "#000000"
      },
      "close": {
        "color": "#000000",
        ":hover": {
          "color": "#000000"
        }
      },
      "empty": {
        "color": "#000000"
      },
      "noteDescription": {
        "color": "#000000"
      },
      "discountText": {
        "color": "#000000"
      },
      "discountIcon": {
        "fill": "#000000"
      },
      "discountAmount": {
        "color": "#000000"
      }
    },
    "text": {
      "title": "Shopping Cart",
      "total": "Subtotal",
      "button": "Checkout"
    },
    "popup": false,
    "googleFonts": [
      "Roboto"
    ]
  },
  "toggle": {
    "styles": {
      "toggle": {
        "font-family": "Roboto, sans-serif",
        "font-weight": "bold",
        "background-color": "#000000",
        ":hover": {
          "background-color": "#000000"
        },
        ":focus": {
          "background-color": "#000000"
        }
      }
    },
    "googleFonts": [
      "Roboto"
    ]
  },
  "lineItem": {
    "styles": {
      "variantTitle": {
        "color": "#000000"
      },
      "title": {
        "color": "#000000"
      },
      "price": {
        "color": "#000000"
      },
      "fullPrice": {
        "color": "#000000"
      },
      "discount": {
        "color": "#000000"
      },
      "discountIcon": {
        "fill": "#000000"
      },
      "quantity": {
        "color": "#000000"
      },
      "quantityIncrement": {
        "color": "#000000",
        "border-color": "#000000"
      },
      "quantityDecrement": {
        "color": "#000000",
        "border-color": "#000000"
      },
      "quantityInput": {
        "color": "#000000",
        "border-color": "#000000"
      }
    }
  }
},
      });
    });
  }
})();
/*]]>*/
</script>

I’ve searched everywhere but I’m not good at coding, so if there is a possible solution I can use, I would appreciate it. Thanks

How to make register command on discord.js and mongodb atlas?

I want to save my discord member data using register command, please help me!!

bot.js

 client.on("message", msg => {
  if (msg.content === "!register, ign:<input from member>, level:<input from member>"){
    const newProfileSchema = new ProfileSchema({
      discordid: "Discord Member Username",
      ign: "<input from member>",
      level: "<input from member>",
    })
  }
})

And this is the schema look like
Schema.js

const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const ProfileSchema = new Schema({
  discordid: {
    type: String,
    required: true
  },
  ign: {
    type: String
  },
  level: {
    type: Number
  }
});

module.exports = User = mongoose.model('profile', ProfileSchema);

Removing vertical gridlines and preventing height resizing

I have two questions about using Chart.js.

  1. Is there any way to remove the vertical gridlines. I don’t think they serve any purpose in my bar charts, and it looks a little cleaner without them.

  2. When the charts resize, is there any way to have them retain their original height? They seem to maintain their width/height ratio. I think I’d like to keep the height from changing.

Selenium iframes problems

I’am using Selenium with C#, i have a problem with iframe.

I’m trying to make a comment but once i open the comment section of a thread, i can’t interact with the components. I know there is iframe and maybe nested iframes. So for i tried:

var iframeList = d.FindElements(By.TagName("iframe"));
using (var sw = new StreamWriter(String.Format(@"{0}iframe.txt", f.GetFolderPath())))
{
    foreach(IWebElement element in iframeList)
    {
        sw.WriteLine(element);
    }                           
}

this part of code below give me this result inside my txt file:

Element (id = 10f1b5bf-a2ce-4ffe-92a6-d2dc8e55bf5a)

note that the id above change each time i try to run the code and sometime there is 2 differents id

also when i inspect the webpage element(F12), the iframe id=”here is the id” constantly change each time i run my code.

So for switching the iframe, i did this:

var iframeList = d.FindElements(By.TagName("iframe"));
IWebElement[] iframeArr = iframeList.ToArray();
using (var sw = new StreamWriter(String.Format(@"{0}iframe.txt", f.GetFolderPath())))
{
    for(int j = 0; j < iframeArr.Length; j++)
    {
        sw.WriteLine(iframeArr[j].ToString()); //write to file
    }                           
}

d.SwitchTo().Frame(iframeArr[0]);

code above seem to switch to an iframe but still can’t access components of the page.

I also tried switching with nested iframes:

var iframeList = d.FindElements(By.TagName("iframe"));
IWebElement[] iframeArr = iframeList.ToArray();
using (var sw = new StreamWriter(String.Format(@"{0}iframe.txt", f.GetFolderPath())))
{
    for(int j = 0; j < iframeArr.Length; j++)
    {
        sw.WriteLine(iframeArr[j].ToString()); //write to file
    }                           
}

d.SwitchTo().Frame(iframeArr[0]);
d.SwitchTo().Frame(iframeArr[1]);

Code above also don’t work.

Some other examples i tried with no results:

d.SwitchTo().Frame(d.FindElement(By.XPath("/html/body/iframe")));
//Dont work

d.SwitchTo().Frame(d.FindElement(By.XPath("//iframe[@class='GTM-5XVNS82']")));
//Dont work

d.SwitchTo().Frame((IWebElement)wait.Until(SeleniumExtras.WaitHelpers.
ExpectedConditions.FrameToBeAvailableAndSwitchToIt(By.TagName("iframe"))));
//Dont work

var iframe = d.FindElement(By.CssSelector("[src*='https://www.redditmedia.com/gtm/jail? 
id=GTM-5XVNS82']"));
//Dont work

d.SwitchTo().Frame(0);
//Dont work

d.SwitchTo().Frame(0);
d.SwitchTo().Frame(1);
//Dont work

I also tried numerous other methods and still no succes. I can’t copy the code as it look like in the google inspect so i made a screenshot of the iframe code:
enter image description here

Sry for the code in the screenshot i tried to copy the code but it just dont work properly.

Hope someone can give me an hand its been days i’m on this problem and i absolutely don’t know what to do at this point.

Thank you!

Leaflet no tile (Angular)

I try to use leaflet with non-geographical image. When I follow the documentation I don’t get the same result (https://leafletjs.com/examples/crs-simple/crs-simple.html). I expect my output to be like below, but it’s like the other picture

i expect it to be

My output

Are there any configuration for CRS ? or TileLayer?

Note: My source code is same as in official document(https://leafletjs.com/examples/crs-simple/crs-simple.html)