Skip to content

Instantly share code, notes, and snippets.

View manoj9788's full-sized avatar
🏠
Working from home

Manoj Kumar manoj9788

🏠
Working from home
View GitHub Profile
package com.applitools.seleniumJavaExamples;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeMethod;
public Image Base64ToImage(string base64String)
{
// Convert Base64 String to byte[]
byte[] imageBytes = Convert.FromBase64String(base64String);
MemoryStream ms = new MemoryStream(imageBytes, 0,
imageBytes.Length);
// Convert byte[] to Image
ms.Write(imageBytes, 0, imageBytes.Length);
Image image = Image.FromStream(ms, true);
public string ImageToBase64(Image image,
System.Drawing.Imaging.ImageFormat format)
{
using (MemoryStream ms = new MemoryStream())
{
// Convert Image to byte[]
image.Save(ms, format);
byte[] imageBytes = ms.ToArray();
// Convert byte[] to Base64 String
java -jar selenium-server-standalone-3.0.1.jar -role node -hub http://localhost:4444/grid/register -browser browserName=firefox,maxInstances=3 -browser browserName=chrome,maxInstances=5
@manoj9788
manoj9788 / Selenium Grid workshop pre-requisites.md
Created March 20, 2017 20:58
Selenium Grid workshop pre-requisites
@manoj9788
manoj9788 / MicrosoftEdge.json
Last active December 12, 2016 01:45
MicrosoftEdge config json file
/*
java -jar selenium-standalone-server-3.0.1.jar -nodeConfig config.json
-port 4444 -hub http://<host>:<port>/grid/register -host <ip address of win10 vm> -role node
*/
{
"capabilities":
[
{ "browserName":"MicrosoftEdge",
"maxInstances":1,
#Rename the file to be docker-compose
#docker-compose scale up file
#To execute this docker-compose yml file use docker-compose up -d
#selenium-hub: equivalent to manually running the command docker run -d -p 4444:4444 --name selenium-hub -P selenium/hub
selenium-hub:
restart: always
image: selenium/hub:latest
ports:
- "4444:4444"
@manoj9788
manoj9788 / webdriverjsParallelTests.js
Last active November 9, 2016 05:55
A simple demo on achieving parallel test run using control flow in nodeJs version of WebDriver
var webdriver = require('selenium-webdriver'),
By = webdriver.By,
until = webdriver.until;
var _ = require('underscore');
var terms = [
'selenium',
'webdriver'
];
var flows = terms.map(function(term) {
@manoj9788
manoj9788 / docker-compose.yml
Last active May 31, 2018 11:07
A sample YAML file to spin up Selenium Grid via docker-compose
# docker-compose file
# To execute this docker-compose yml file use docker-compose -f <file_name> up
# Add the "-d" flag at the end for deattached execution
#selenium-hub: equivalent to manually running the command docker run -d -p 4444:4444 --name selenium-hub -P selenium/hub:3.6.0-bromine
selenium-hub:
restart: always
image: selenium/hub:3.8.1-aluminum
ports:
- "4444:4444"
Manoj:protractor-master manoj$ npm test
> protractor@3.3.0 pretest /Users/manoj/Downloads/protractor-master
> gulp pretest
[11:50:24] Using gulpfile ~/Downloads/protractor-master/gulpfile.js
[11:50:24] Starting 'pretest'...
[11:50:24] Starting 'webdriver:update'...
[11:50:24] Starting 'typings'...
[11:50:24] Starting 'jshint'...