<a> tag ( <a href="some_url">Link</a> ) using driver.FindElement in Selenium C#, you can use different locat...
Read More
Hi
deserialize the JSON File Has Correct Formatting in c#
using System; using System.IO; using System.Text.Json; class Program { static void Main() { string json = File.ReadAllText(...
Read More
Use JsonDocument for Advanced JSON Parsing
using System; using System.IO; using System.Text.Json; class Program { static void Main() { string json = File.ReadAllText(...
Read More
Reading JSON from a File using c#
using System; using System.IO; using Newtonsoft.Json; class Program { static void Main() { string json = File.ReadAllText(...
Read More
Writing JSON to a File using C#
using System; using System.IO; using Newtonsoft.Json; class Program { static void Main() { var person = new { Name = "...
Read More
creating dynamic elements in winforms and click events with child elements and remove elements
Panel panel = new Panel { Size = new Size(pnlparent.Width, 100), // Set a proper size for visibility Location = new Point(10, y), /...
Read More
DWM method does not work, you can remove the default title bar and create a custom header.
using System; using System.Drawing; using System.Windows.Forms; public class CustomForm : Form { private Panel headerPanel; private...
Read More
Change Form Title Bar (Caption) Text Color in Windows Forms (C#)
using System; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; public class MyForm : Form { cons...
Read More
Get Value from Multiple Elements (querySelectorAll) using selenium c#
var jsExecutor = (IJavaScriptExecutor)driver; var values = (IReadOnlyCollection<IWebElement>)jsExecutor.ExecuteScript( "retu...
Read More
Enter Text and Retrieve Value using selenium c#
using OpenQA.Selenium; using OpenQA.Selenium.Chrome; using System; class Program { static void Main() { IWebDriver driver =...
Read More
element reading using selenium
Use By.XPath("//a[text()='Text']") for exact matches. Use By.XPath("//a[contains(text(),'Text')]") f...
Read More
Using JavaScript (querySelectorAll)
IJavaScriptExecutor js = (IJavaScriptExecutor)driver; IWebElement link = (IWebElement)js.ExecuteScript( "return [...document.query...
Read More
Use By.CssSelector in XPATh
IWebElement link = driver.FindElement(By.CssSelector("a[href*='services']"));
Read More
Click on a Parent or Child Element Instead
IWebElement parent = driver.FindElement(By.XPath("//a[contains(text(),'Services')]/..")); parent.Click();
Read More
Remove disabled Attribute
js.ExecuteScript("arguments[0].removeAttribute('disabled');", element); element.Click();
Read More
Click a Disabled Element in Selenium
IJavaScriptExecutor js = (IJavaScriptExecutor)driver; js.ExecuteScript("arguments[0].style.pointerEvents = 'auto';", elem...
Read More
Force Close Modal Before Clicking
IJavaScriptExecutor js = (IJavaScriptExecutor)driver; js.ExecuteScript("$('.modal').modal('hide');"); // Hide Boo...
Read More
Remove data-dismiss Before Clicking
IWebElement button = driver.FindElement(By.CssSelector("button[data-dismiss='modal']")); IJavaScriptExecutor js = (IJavaS...
Read More
Update Collection to Store Dates in IST
db.collection.find().forEach(doc => { var istDate = new Date(doc.createdAt).toLocaleString("en-IN", { timeZone: "Asia...
Read More
Python (pymongo) - Convert ISODate to Indian Format
from pymongo import MongoClient from datetime import datetime import pytz client = MongoClient("mongodb://localhost:27017") db = ...
Read More
C# (MongoDB.Driver) - Convert ISODate to IST
using MongoDB.Driver; using System; var client = new MongoClient("mongodb://localhost:27017"); var database = client.GetDatabase(...
Read More
Node.js (Mongoose) - Convert to IST
const mongoose = require("mongoose"); const mySchema = new mongoose.Schema({ createdAt: { type: Date, default: Date.now } });...
Read More
CoreWebView2_WebMessageReceived is not fired
private async void InitializeWebView() { await webView.EnsureCoreWebView2Async(null); // Ensure WebView2 is initialized webView.Co...
Read More
Once WebView2 is ready, inject the script to capture input field changes
webView.CoreWebView2.NavigationCompleted += (sender, args) => { webView.CoreWebView2.ExecuteScriptAsync(@" document.get...
Read More
Handle WebMessageReceived in C#
private void CoreWebView2_WebMessageReceived(object sender, CoreWebView2WebMessageReceivedEventArgs e) { string inputValue = e.WebMessa...
Read More
Manually Trigger JavaScript to Debug
webView.CoreWebView2.ExecuteScriptAsync("window.chrome.webview.postMessage('Test Message from vinu);");
Read More
WebMessageReceived with navigation completed in c#
using System; using System.Windows.Forms; using Microsoft.Web.WebView2.Core; namespace WebView2Demo { public partial class Form1 : Form...
Read More
C# Code to Capture Phone Link Notifications
using System; using System.Linq; using System.Threading.Tasks; using Windows.UI.Notifications.Management; using Windows.UI.Notifications; n...
Read More
Read and write the mobile phone messages using c#
using System; using System.Windows.Automation; class Program { static void Main() { // Find the "Phone Link" wind...
Read More
Find and Read Messages Using FlaUI using c#
using System; using FlaUI.Core; using FlaUI.UIA3; using FlaUI.Core.AutomationElements; using System.Linq; class Program { static void M...
Read More
change background color of the form header area in windows form c#
using System; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; public class MyForm : Form { cons...
Read More
removes the default title bar and replaces it with a custom panel
using System; using System.Drawing; using System.Windows.Forms; public class CustomForm : Form { private Panel headerPanel; public ...
Read More
Subscribe to:
Posts (Atom)