Skip to content

Instantly share code, notes, and snippets.

View prashanth-sams's full-sized avatar
🍎
Each day is interesting!!!

Prashanth Sams prashanth-sams

🍎
Each day is interesting!!!
View GitHub Profile
@JosephPecoraro
JosephPecoraro / shell-execution.rb
Last active September 10, 2023 10:12
Shell Execution in Ruby
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Synchronous (blocking)
# Returns the output of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111
# These are my notes from the PragProg book on CoffeeScript of things that either
# aren't in the main CS language reference or I didn't pick them up there. I wrote
# them down before I forgot, and put it here for others but mainly as a reference for
# myself.
# assign arguments in constructor to properties of the same name:
class Thingie
constructor: (@name, @url) ->
# is the same as:
@krmahadevan
krmahadevan / ClassWithListener
Created February 3, 2012 07:08
Demo that shows how to make use of Event Firing Web Driver.
package com.test;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.By;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.events.EventFiringWebDriver;
import org.testng.annotations.Test;
@huangzhichong
huangzhichong / selenium-webdriver-cheatsheet.md
Created August 7, 2012 12:38
Selenium Webdriver CheatSheet

API workthough

  1. Open a browser

    # start an instance of firefox with selenium-webdriver
    driver = Selenium::WebDriver.for :firefox
    # :chrome -> chrome
    # :ie     -> iexplore
    
  • Go to a specified URL
@krmahadevan
krmahadevan / PlayingWithListenerFactory.java
Created September 17, 2012 08:22
How to use ITestNGListenerFactory
package testng.samples;
import org.testng.IExecutionListener;
import org.testng.ITestNGListener;
import org.testng.ITestNGListenerFactory;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
/*
@krmahadevan
krmahadevan / EclipseConsoleLogs.txt
Created October 18, 2012 05:16
Sample that shows how to do parallel executions with IE using IEDriverServer.exe
Suites: 0 and:0
[TestNG] Running:
C:\Users\krmahadevan\AppData\Local\Temp\testng-eclipse--361118992\testng-customsuite.xml
[TestRunner] Starting executor for test Default test with time out:2147483647 milliseconds.
bar() running in Thread #11
foo() running in Thread #12
Started InternetExplorerDriver server (32-bit)
2.26.0.6
Listening on port 36943
@krmahadevan
krmahadevan / DemoToShowHowToRunSuitesInParallelViaTestNGAPI.java
Created November 26, 2012 14:58
A sample that shows how to Use the TestNG APIs and run suites in parallel
package testng.samples;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import org.testng.ITestContext;
import org.testng.TestNG;
@prashanth-sams
prashanth-sams / iFrames- Finding presenceOfElementLocated (Expected Condition) & Timeout set to 5 secs
Last active December 16, 2015 21:29
iFrames- Finding presenceOfElementLocated (Expected Condition) & Timeout set to 5 secs
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
@Test
public void test() throws Exception {
try{
driver.switchTo().frame(driver.findElement(By.cssSelector("iframe[id='**********']")));
new WebDriverWait(driver, 5)
.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("**********")));
@rxaviers
rxaviers / gist:7360908
Last active July 22, 2024 11:10
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@kenrett
kenrett / Selenium Cheat Sheet.md
Last active May 25, 2023 01:28
Selenium Cheat Sheet - Ruby

#Getting Started

##Webpage:

<html>
<head>
    <title>Testing with Ruby and Selenium WebDriver</title>
</head>
 
<body bgcolor="antiquewhite">