Open url using Selenium Chromedriver c#

This is a simple example to show how to navigate to url using selenium chromedriver

Install selenium webdriver using Nuget Package

PM> Install-Package Selenium.WebDriver.ChromeDriver -Version 80.0.3987.10600

Below code performs a navigation to google.com

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Support.UI;
using System.Collections.ObjectModel;
using System.Threading;
using System.Configuration;


namespace OpenURL
{
    class Program
    {
        static void Main(string[] args)
        {
            IWebDriver driver = null;
            try
            {

                //driver = new ChromeDriver(@"c:\temp\");//load chromedriver from desired folder.
                driver = new ChromeDriver(AppDomain.CurrentDomain.BaseDirectory);//load chromedriver from bin folder as nuget package deploys chrome driver .exe and other dlls into bin
                driver.Url = "https://www.google.com";//Set the url you would like to navigate
                driver.Manage().Window.Maximize();
                driver.Navigate();
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception" + e.ToString());
            }

            finally
            {
                Thread.Sleep(2000);
                driver.Quit();
                Console.ReadLine();
            }
        }
    }
}

Use bin or desired folder to load chrome driver

 driver = new ChromeDriver(AppDomain.CurrentDomain.BaseDirectory);
//this helps loading chromedriver from bin folder
driver = new ChromeDriver(@"c:\temp\");
//this helps to load chromdriver.exe from temp folder.

Calculation in SharePoint Designer – Workflow

There are two ways to perform a calculation.

  1. By creating a calculated column for the library and use excel formulas
  2. Using SharePoint designer workflow.

This will help you to perform any calculations using workflow.

Select “Do calculation” from “Action”

you can perform basic mathematical operations like addition, multiplication, division, etc., and store into workflow variable.

Then the workflow variable can be updated into a library column

Sort Array object python

This code will help to sort any custom list object in ascending or descending order

accuracy=[
        {
            "Alg": "DecisionTree",
            "val": 90
        },
        {
            "Alg": "GradientBoosting",
            "val": 60
        },
        {
            "Alg": "LinearRegression",
            "val": 95
        },
        {
            "Alg": "LogisticRegression",
            "val": 96
        }
    ]

ascending=sorted(accuracy, key = lambda i: float(i['val']))
print(ascending)
desc=sorted(accuracy, key = lambda i: float(i['val']),reverse=True)
print(desc)
Output

[{'Alg': 'GradientBoosting', 'val': 60}, {'Alg': 'DecisionTree', 'val': 90}, {'Alg': 'LinearRegression', 'val': 95}, {'Alg': 'LogisticRegression', 'val': 96}]
[{'Alg': 'LogisticRegression', 'val': 96}, {'Alg': 'LinearRegression', 'val': 95}, {'Alg': 'DecisionTree', 'val': 90}, {'Alg': 'GradientBoosting', 'val': 60}]