Skip to content

Instantly share code, notes, and snippets.

View ShamaUgale's full-sized avatar

Shama Ugale ShamaUgale

View GitHub Profile
@ShamaUgale
ShamaUgale / SetDeviceMode.java
Last active September 18, 2021 22:32
This is an example of setting the device mode with height width and scalefactor with devtools and selenium4
package com.devtools;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.devtools.DevTools;
import java.util.HashMap;
import java.util.Map;
public class SetDeviceMode {
final static String PROJECT_PATH = System.getProperty("user.dir");
package com.devtools;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.devtools.DevTools;
import org.openqa.selenium.devtools.log.Log;
public class CaptureConsoleLogs {
private static ChromeDriver driver;
private static DevTools chromeDevTools;
import org.openqa.selenium.WindowType;
import org.openqa.selenium.chrome.ChromeDriver;
import java.io.IOException;
import java.util.Iterator;
import java.util.Set;
/*
This is an example to demonstarte the usage of newWindow() method in Selenium 4
New window or tabbed windows can be created and used in the single session and switch between them with
switchTo().window() method
@ShamaUgale
ShamaUgale / createChilProc.py
Created January 7, 2021 06:54
Make a python program that creates 1 child process which pushes random integers until the parent terminates to the parent process every 1 second for N seconds, not known until after the child process is created, have the parent read and print the integers, then have the program terminate correctly.
import os
import random
import multiprocessing
def createChildProcess(sec):
q = multiprocessing.Queue()
n = os.fork()
for i in range(1, sec):
if n==0:
Morning
- ajwain water - soak it over night and next day boil n drink
- 1 fruit
- Workout
- Tea
- Breakfast is oats chilla
Afternoon
- Lunch - a raita - a chapati - 1 chapati - salad
- A snack (fruit)
@ShamaUgale
ShamaUgale / fib.py
Created January 7, 2021 06:48
Write a program that takes a parameter 'n' and prints the first n prime numbers in the Fibonacci sequence.
def FibonacciSeries(n):
    if n<=0:
        print("Incorrect input")
    elif n==1:
        return 0
    elif n==2:
        return 1
    else:
        return FibonacciSeries(n-1)+FibonacciSeries(n-2)
  
java -jar selenium-server-4.0.0-alpha-6.jar event-bus
java -jar selenium-server-4.0.0-alpha-1.jar router --sessions http://localhost:5556 --distributor http://localhost:5553
java -jar selenium-server-4.0.0-alpha-7.jar distributor --sessions http://localhost:5556
java -jar selenium-server-4.0.0-alpha-7.jar sessions