Skip to content

Instantly share code, notes, and snippets.

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

Rafael Carvalho rafaelcs

🏠
Working from home
View GitHub Profile
@rafaelcs
rafaelcs / Example_SeleniumC#
Last active August 29, 2015 14:27
Help user Selenium_groups - Structure test
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Support.UI;
using OpenQA.Selenium.Remote;
using OpenQA.Selenium.Interactions;
using System.Collections.ObjectModel;
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:trav="http://schemas.datacontract.org/2004/07/TravelExplorer.DataTravel.WebService.Messages" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<tem:SavePackage>
<!--Optional:-->
<tem:rPack>
<!--Optional:-->
<trav:Language>pt</trav:Language>
<!--Optional:-->
<trav:Password>12345</trav:Password>
@rafaelcs
rafaelcs / DesafioArray
Created May 20, 2015 21:56
Desafio Array
package teste;
public class TesteDesafio {
public static void main(String[] args) {
int[] a = {6,8,8,7,2,9};
int elemento1 = 0, elemento2 = 0, resultado = 0;
for (int i = 0; i < a.length; i++) {
for (int j = i + 1; j < a.length; j++) {
if ((a[i] % 3 != 0) && (a[j] % 3 != 0))
continue;
@rafaelcs
rafaelcs / example
Created April 29, 2015 16:26
Code Example Using Selenium Webdriver + Rspec
require "selenium-webdriver"
require "rspec"
require 'rspec/expectations'
require "faker"
describe "#Add expense and create report", :suite => true do
before(:all) do
@driver = Selenium::WebDriver.for :chrome
@base_url = "https://mysite.com"
@rafaelcs
rafaelcs / example
Created April 22, 2015 19:57
Example to run Nunit in order
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Support.UI;
using OpenQA.Selenium.Remote;
using OpenQA.Selenium.Interactions;
require "selenium-webdriver"
require "rspec"
require 'rspec/expectations'
describe "#Add simple expense with receipt", :suite => true do
before(:all) do
@driver = Selenium::WebDriver.for :chrome
@base_url = "https://mytest.com"
@driver.manage.window.maximize
@rafaelcs
rafaelcs / uploadfile
Last active August 29, 2015 14:18
upload file sauce labs + selenium
ENV['SAUCE_USERNAME'] = 'myname'
ENV['SAUCE_API_KEY'] = 'my_api'
require "selenium-webdriver"
require "rspec"
require 'rspec/expectations'
describe "#Add simple expense and after add a receipt", :saucelabs => true do
before(:all) do
@rafaelcs
rafaelcs / gist:417b34c90c624d117b3a
Created March 25, 2015 19:25
Example Sauce Labs
require "selenium-webdriver"
require "rspec"
require 'rspec/expectations'
describe "#Add simple expense and after add a receipt", :suite => true do
before(:all) do
@driver = Selenium::WebDriver.for :chrome
@base_url = "https://myurl.com"
@driver.manage.window.maximize
<div class="col-lg-9 m-b">
<input id="expense_attachment_new" class="file optional" type="file" name="attachment" style="position: fixed; left: -1000px;">
<div class="bootstrap-filestyle" style="display: inline;">
<input class="input-large form-control inline v-middle input-s" type="text" disabled="">
<label class="btn btn-default" for="expense_attachment_new">
<i class="icon-folder-open"></i>
<span>Choose file</span>
</label>
</div>
<div class=".uploader-state"></div>