Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Rafael Carvalho rafaelcs

🏠
Working from home
View GitHub Profile
View xml
<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>
View DesafioArray
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 Apr 29, 2015
Code Example Using Selenium Webdriver + Rspec
View example
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 Apr 22, 2015
Example to run Nunit in order
View example
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;
View gist:dd4db18ba76d367aaf14
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 Aug 29, 2015
upload file sauce labs + selenium
View uploadfile
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
View gist:417b34c90c624d117b3a
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
View field and button to upload
<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>
You can’t perform that action at this time.