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
@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("**********")));
{
"auto_find_in_selection": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"create_window_at_startup": true,
"find_selected_text": true,
"font_size": 11,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
@prashanth-sams
prashanth-sams / Selenium-Ruby_Test
Last active August 29, 2015 14:01
Sample Selenium Test using Ruby Bindings
#!/usr/local/bin/ruby
require 'rubygems'
require "selenium-webdriver"
driver = Selenium::WebDriver.for :firefox
driver.navigate.to "http://google.com"
element = driver.find_element(:name, 'q')
element.send_keys "Prashanth Sams"
element.submit
@prashanth-sams
prashanth-sams / Selenium-Ruby_RSpec
Last active August 29, 2015 14:01
Sample Selenium Test using RSpec Unit Test Framework
#!/usr/local/bin/ruby
require "selenium-webdriver"
require "rspec"
describe "Google Search" do
before(:each) do
@driver = Selenium::WebDriver.for :firefox
@base_url = "https://www.google.co.in"
@accept_next_alert = true
@prashanth-sams
prashanth-sams / Git_commands.md
Last active November 1, 2017 09:57
Git work-around for newbies

Git clone, add, commit, pull, push

git clone https://.....git
git clone -b <branchname> https://.....git
git status -s
git add README.md | git add lib/* log/* | git add .
git status -s commit -m "updated readme"
git pull origin master
git push origin master | git push https://.....git master
@prashanth-sams
prashanth-sams / Capybara Cheat_sheet
Last active August 29, 2015 14:02
Way to Go - Capybara
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
How to Set Temporary Java Environment
==========================================
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_03
export PATH=$PATH:$JAVA_HOME/bin
javac -version
which javac
How to populate data
==========================================
Clear Cookies
==============
page.driver.browser.clear_cookies
package pack;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;