#Getting Started
##Webpage:
<html>
<head>
<title>Testing with Ruby and Selenium WebDriver</title>
</head>
<body bgcolor="antiquewhite">
=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') |
require 'rails_helper' | |
feature "Business Search", js: true do | |
let(:user) { create :user } | |
let!(:business) { create :business, name: "Some Business" } | |
let!(:business2) { create :business, name: "The other Business" } | |
let(:businesses_page) { BusinessesPage.new } | |
let(:app) { App.new } | |
let(:search_field) { businesses_page.business_search } | |
let(:biz_container) { businesses_page.main.root_element } |
#Getting Started
##Webpage:
<html>
<head>
<title>Testing with Ruby and Selenium WebDriver</title>
</head>
<body bgcolor="antiquewhite">
"use strict"; | |
var Page = require('../Page') | |
var Fragment = require('../Fragment') | |
class LoginPage extends Page { | |
constructor() { | |
super('/login'); | |
this.emailField = $('input.email'); | |
this.passwordField = $('input.password'); |
Free O'Reilly books and convenient script to just download them.
Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post
How to use:
download.sh
file and put it into a directory where you want the files to be saved.cd
into the directory and make sure that it has executable permissions (chmod +x download.sh
should do it)./download.sh
and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.// date format 2014-12-21T11:32:26.341Z | |
date = new Date().toISOString(); | |
postman.setEnvironmentVariable("date", date); | |
// timestamp example: 1515684365 | |
let randomized = Math.floor(Date.now() / 1000); | |
postman.setEnvironmentVariable("randomized", randomized); | |
// past date | |
date = new Date(); |
# tPortmonetka - przejazdy | |
# range of positions: position() >= 100 and not(position() > 200) | |
# get last column | |
let cost_col = $x("//*[@id='dataTable']//tr[position() >= 100 and not(position() > 200)]/td[last()]/div"); | |
# parse to float | |
let float_cost_col = cost_col.map(el => parseFloat(el.innerText.replace(',', '.'))); | |
# sum |
function getElementByXpath(path) { | |
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; | |
} |
/* | |
Disclaimers: | |
1. The script works for currently loaded transactions, so make sure to set the correct date range. | |
2. Supports only credit card history and only transactions that are already booked. | |
3. No data is saved by the script to third party locations | |
*/ | |
class CreditHistoryScraper { | |
transactions() { |
loop do | |
break if profile_page.has_resume? | |
profile_page.execute_script( | |
"document.querySelector('.dialog-scroll-container').scrollTo(0, 1000);" | |
) | |
end |