This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To completely uninstall node + npm is to do the following: | |
go to /usr/local/lib and delete any node and node_modules | |
go to /usr/local/include and delete any node and node_modules directory | |
if you installed with brew install node, then run brew uninstall node in your terminal | |
check your Home directory for any "local" or "lib" or "include" folders, and delete any "node" or "node_modules" from there | |
go to /usr/local/bin and delete any node executable | |
You may need to do the additional instructions as well: | |
remove: /usr/local/bin/npm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hudson.model.* | |
for(item in Hudson.instance.items) { | |
println("JOB : "+item.name) | |
item.disabled=true | |
item.save() | |
println("\n=======\n") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HashMap<String, String> scrollObject = new HashMap<String, String>(); | |
//Must be an element with scrollable property; Android (ListView,ScrollabeView) IOS (UIAScrollableView | |
RemoteWebElement element = (RemoteWebElement) driver.findElement(By.[id/name/etc](scrollableElement)); | |
JavascriptExecutor js = (JavascriptExecutor) driver; | |
String widId = ((RemoteWebElement) element).getId(); | |
//Text for search on the screen | |
scrollObject.put("text", text); | |
scrollObject.put("element", widId); | |
js.executeScript("mobile: scrollTo", scrollObject); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So you'd like to manage your iOS devices by command line? | |
You can use libimobiledevice tools for that. | |
Easy on Linux. Let's see how it is on Mac OS X. | |
You'll need to: | |
1. install Xcode | |
2. start Xcode and agree to it's license | |
3. install Xcode command line tools (Start Xcode, Go to Preferences -> Downloads tab) | |
4. install homebrew by this command (sudo password will be prompted) | |
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// how to capture screens? | |
File screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); | |
String filename = "c:\\screenshot098765.png"; | |
FileUtils.copyFile(screenshot, new File(filename)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WebElement end = driver.findElements(By.className("android.widget.TextView")).get(10); | |
((RemoteWebElement)end).getId(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Selenium | |
// Manual Drag And Drop | |
Action dragAndDrop = new Actions(driver) | |
.clickAndHold(element1) | |
.moveToElement(element2) | |
.release() | |
.build(); | |
dragAndDrop.perform(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ScreenShotRemoteWebDriver extends RemoteWebDriver implements TakesScreenshot { | |
public ScreenShotRemoteWebDriver(URL url, DesiredCapabilities capabilities) { | |
super(url, capabilities); | |
} | |
public <X> X getScreenshotAs(OutputType<X> target) throws WebDriverException { | |
if ((Boolean)getCapabilities().getCapability(CapabilityType.TAKES_SCREENSHOT)) { | |
return target.convertFromBase64Png(execute(DriverCommand.SCREENSHOT).getValue().toString()); | |
} | |
return null; | |
}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch( deviceType ) | |
{ | |
case HEADNODE: | |
return true; | |
case STORAGE: | |
for( String metric : metricsList ) | |
{ | |
if( metric.contains( METRIC_KEY_STORAGE ) ) | |
specificMetricCount++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BrowserFactory.getExistentWebDriver().switchTo().frame( "outerFrame" ); | |
WebElement ele = | |
BrowserFactory.getExistentWebDriver().findElement( By.cssSelector( "canvas.flot-overlay" ) ); | |
File screenshot = ( ( TakesScreenshot ) BrowserFactory.getExistentWebDriver() ).getScreenshotAs( OutputType.FILE ); | |
BufferedImage fullImg = ImageIO.read( screenshot ); | |
Point point = ele.getLocation(); | |
int eleWidth = ele.getSize().getWidth(); | |
int eleHeight = ele.getSize().getHeight(); |
NewerOlder