Java developer
SDET (remote)
Gap Year
NodeJs developer
2015/11
2015/01
2014/04
2009
是你最好的好朋友
給自己的 10 堂外語課
Java developer
SDET (remote)
Gap Year
NodeJs developer
2015/11
2015/01
2014/04
2009
Java developer
SDET (remote)
Gap Year
NodeJs developer
2015/11
2015/01
2014/04
2009
import org.openqa.selenium.*;
public class Selenium2Example {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
WebElement element = driver.findElement(By.name("q"));
element.sendKeys("Selenium");
element.submit();
System.out.println("Title: " + driver.getTitle());
driver.quit();
}
}
client
.url('http://google.com')
.setValue('#q', 'webdriver')
.click('#btnG')
driver.get('http://www.google.com');
driver.findElement(webdriver.By.id('q')).sendKeys('webdriver');
driver.findElement(webdriver.By.id('btnG')).click();
var assert = require('assert');
describe('mokayo page', function() {
it('should have the right title', function() {
browser.url('http://blog.mokayo.com');
var title = browser.getTitle();
assert.equal(title, '教你所想學的,用眼樂讀 - blog.mokayo.com');
});
});
var util = require('util'),
events = require('events');
var CustomReporter = function(options) {
};
// Inherit from EventEmitter
util.inherits(CustomReporter, events.EventEmitter);
// Expose Custom Reporter
exports = module.exports = CustomReporter;
var CustomReporter = require('./reporter/my.custom.reporter');
exports.config = {
reporters: [CustomReporter],
};
browser.addCommand('doExternalJob', function async (params) {
return externalLib.command(params);
});
it('execute external library in a sync way', function() {
browser.url('...');
browser.doExternalJob('someParam');
console.log(browser.getTitle());
});
mobile test
java
-Dwebdriver.chrome.driver=chromedriver.exe
-jar selenium-server-standalone-2.53.0.jar
chimp --mocha --watch --path=test
@focus,@dev,@watch
const assert = require('assert');
describe('Google search', function() {
it('case 1: @watch', function() {
browser.url('http://www.google.com/ncr');
browser.setValue('[name=q]', 'alincode blog');
browser.click('[name=btnG]');
assert.equal(browser.getTitle(), 'Google');
});
});
body > div.views > div.page.page-on-center > div.list-section-bar > span:nth-child(2)
.list-section-bar > span:nth-child(2)