id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
124,700
alibaba/canal
client-adapter/elasticsearch/src/main/java/com/alibaba/otter/canal/client/adapter/es/support/ESTemplate.java
ESTemplate.updateByQuery
public void updateByQuery(ESSyncConfig config, Map<String, Object> paramsTmp, Map<String, Object> esFieldData) { if (paramsTmp.isEmpty()) { return; } ESMapping mapping = config.getEsMapping(); BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery(); paramsTmp.forEac...
java
public void updateByQuery(ESSyncConfig config, Map<String, Object> paramsTmp, Map<String, Object> esFieldData) { if (paramsTmp.isEmpty()) { return; } ESMapping mapping = config.getEsMapping(); BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery(); paramsTmp.forEac...
[ "public", "void", "updateByQuery", "(", "ESSyncConfig", "config", ",", "Map", "<", "String", ",", "Object", ">", "paramsTmp", ",", "Map", "<", "String", ",", "Object", ">", "esFieldData", ")", "{", "if", "(", "paramsTmp", ".", "isEmpty", "(", ")", ")", ...
update by query @param config 配置对象 @param paramsTmp sql查询条件 @param esFieldData 数据Map
[ "update", "by", "query" ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/elasticsearch/src/main/java/com/alibaba/otter/canal/client/adapter/es/support/ESTemplate.java#L130-L166
124,701
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/CharsetConversion.java
CharsetConversion.getCharset
public static String getCharset(final int id) { Entry entry = getEntry(id); if (entry != null) { return entry.mysqlCharset; } else { logger.warn("Unexpect mysql charset: " + id); return null; } }
java
public static String getCharset(final int id) { Entry entry = getEntry(id); if (entry != null) { return entry.mysqlCharset; } else { logger.warn("Unexpect mysql charset: " + id); return null; } }
[ "public", "static", "String", "getCharset", "(", "final", "int", "id", ")", "{", "Entry", "entry", "=", "getEntry", "(", "id", ")", ";", "if", "(", "entry", "!=", "null", ")", "{", "return", "entry", ".", "mysqlCharset", ";", "}", "else", "{", "logge...
Return defined charset name for mysql.
[ "Return", "defined", "charset", "name", "for", "mysql", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/CharsetConversion.java#L348-L357
124,702
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/CharsetConversion.java
CharsetConversion.getCollation
public static String getCollation(final int id) { Entry entry = getEntry(id); if (entry != null) { return entry.mysqlCollation; } else { logger.warn("Unexpect mysql charset: " + id); return null; } }
java
public static String getCollation(final int id) { Entry entry = getEntry(id); if (entry != null) { return entry.mysqlCollation; } else { logger.warn("Unexpect mysql charset: " + id); return null; } }
[ "public", "static", "String", "getCollation", "(", "final", "int", "id", ")", "{", "Entry", "entry", "=", "getEntry", "(", "id", ")", ";", "if", "(", "entry", "!=", "null", ")", "{", "return", "entry", ".", "mysqlCollation", ";", "}", "else", "{", "l...
Return defined collaction name for mysql.
[ "Return", "defined", "collaction", "name", "for", "mysql", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/CharsetConversion.java#L362-L371
124,703
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/CharsetConversion.java
CharsetConversion.getJavaCharset
public static String getJavaCharset(final int id) { Entry entry = getEntry(id); if (entry != null) { if (entry.javaCharset != null) { return entry.javaCharset; } else { logger.warn("Unknown java charset for: id = " + id + ", name = " + entr...
java
public static String getJavaCharset(final int id) { Entry entry = getEntry(id); if (entry != null) { if (entry.javaCharset != null) { return entry.javaCharset; } else { logger.warn("Unknown java charset for: id = " + id + ", name = " + entr...
[ "public", "static", "String", "getJavaCharset", "(", "final", "int", "id", ")", "{", "Entry", "entry", "=", "getEntry", "(", "id", ")", ";", "if", "(", "entry", "!=", "null", ")", "{", "if", "(", "entry", ".", "javaCharset", "!=", "null", ")", "{", ...
Return converted charset name for java.
[ "Return", "converted", "charset", "name", "for", "java", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/CharsetConversion.java#L376-L391
124,704
alibaba/canal
server/src/main/java/com/alibaba/otter/canal/common/MQMessageUtils.java
MQMessageUtils.getPartitionHashColumns
public static HashMode getPartitionHashColumns(String name, String pkHashConfigs) { if (StringUtils.isEmpty(pkHashConfigs)) { return null; } List<PartitionData> datas = partitionDatas.get(pkHashConfigs); for (PartitionData data : datas) { if (data.simpleName != n...
java
public static HashMode getPartitionHashColumns(String name, String pkHashConfigs) { if (StringUtils.isEmpty(pkHashConfigs)) { return null; } List<PartitionData> datas = partitionDatas.get(pkHashConfigs); for (PartitionData data : datas) { if (data.simpleName != n...
[ "public", "static", "HashMode", "getPartitionHashColumns", "(", "String", "name", ",", "String", "pkHashConfigs", ")", "{", "if", "(", "StringUtils", ".", "isEmpty", "(", "pkHashConfigs", ")", ")", "{", "return", "null", ";", "}", "List", "<", "PartitionData",...
match return List , not match return null
[ "match", "return", "List", "not", "match", "return", "null" ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/server/src/main/java/com/alibaba/otter/canal/common/MQMessageUtils.java#L495-L514
124,705
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/TableMapLogEvent.java
TableMapLogEvent.decodeFields
private final void decodeFields(LogBuffer buffer, final int len) { final int limit = buffer.limit(); buffer.limit(len + buffer.position()); for (int i = 0; i < columnCnt; i++) { ColumnInfo info = columnInfo[i]; switch (info.type) { case MYSQL_TYPE_TINY_B...
java
private final void decodeFields(LogBuffer buffer, final int len) { final int limit = buffer.limit(); buffer.limit(len + buffer.position()); for (int i = 0; i < columnCnt; i++) { ColumnInfo info = columnInfo[i]; switch (info.type) { case MYSQL_TYPE_TINY_B...
[ "private", "final", "void", "decodeFields", "(", "LogBuffer", "buffer", ",", "final", "int", "len", ")", "{", "final", "int", "limit", "=", "buffer", ".", "limit", "(", ")", ";", "buffer", ".", "limit", "(", "len", "+", "buffer", ".", "position", "(", ...
Decode field metadata by column types. @see mysql-5.1.60/sql/rpl_utility.h
[ "Decode", "field", "metadata", "by", "column", "types", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/TableMapLogEvent.java#L529-L599
124,706
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java
LogDecoder.decode
public LogEvent decode(LogBuffer buffer, LogContext context) throws IOException { final int limit = buffer.limit(); if (limit >= FormatDescriptionLogEvent.LOG_EVENT_HEADER_LEN) { LogHeader header = new LogHeader(buffer, context.getFormatDescription()); final int len = hea...
java
public LogEvent decode(LogBuffer buffer, LogContext context) throws IOException { final int limit = buffer.limit(); if (limit >= FormatDescriptionLogEvent.LOG_EVENT_HEADER_LEN) { LogHeader header = new LogHeader(buffer, context.getFormatDescription()); final int len = hea...
[ "public", "LogEvent", "decode", "(", "LogBuffer", "buffer", ",", "LogContext", "context", ")", "throws", "IOException", "{", "final", "int", "limit", "=", "buffer", ".", "limit", "(", ")", ";", "if", "(", "limit", ">=", "FormatDescriptionLogEvent", ".", "LOG...
Decoding an event from binary-log buffer. @return <code>UknownLogEvent</code> if event type is unknown or skipped, <code>null</code> if buffer is not including a full event.
[ "Decoding", "an", "event", "from", "binary", "-", "log", "buffer", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java#L96-L141
124,707
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogPosition.java
LogPosition.compareTo
public final int compareTo(String fileName, final long position) { final int val = this.fileName.compareTo(fileName); if (val == 0) { return (int) (this.position - position); } return val; }
java
public final int compareTo(String fileName, final long position) { final int val = this.fileName.compareTo(fileName); if (val == 0) { return (int) (this.position - position); } return val; }
[ "public", "final", "int", "compareTo", "(", "String", "fileName", ",", "final", "long", "position", ")", "{", "final", "int", "val", "=", "this", ".", "fileName", ".", "compareTo", "(", "fileName", ")", ";", "if", "(", "val", "==", "0", ")", "{", "re...
Compares with the specified fileName and position.
[ "Compares", "with", "the", "specified", "fileName", "and", "position", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogPosition.java#L66-L73
124,708
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java
LogBuffer.duplicate
public final LogBuffer duplicate(final int pos, final int len) { if (pos + len > limit) throw new IllegalArgumentException("limit excceed: " + (pos + len)); // XXX: Do momery copy avoid buffer modified. final int off = origin + pos; byte[] buf = Arrays.copyOfRange(buffer, off, off ...
java
public final LogBuffer duplicate(final int pos, final int len) { if (pos + len > limit) throw new IllegalArgumentException("limit excceed: " + (pos + len)); // XXX: Do momery copy avoid buffer modified. final int off = origin + pos; byte[] buf = Arrays.copyOfRange(buffer, off, off ...
[ "public", "final", "LogBuffer", "duplicate", "(", "final", "int", "pos", ",", "final", "int", "len", ")", "{", "if", "(", "pos", "+", "len", ">", "limit", ")", "throw", "new", "IllegalArgumentException", "(", "\"limit excceed: \"", "+", "(", "pos", "+", ...
Return n bytes in this buffer.
[ "Return", "n", "bytes", "in", "this", "buffer", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L40-L47
124,709
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java
LogBuffer.forward
public final LogBuffer forward(final int len) { if (position + len > origin + limit) throw new IllegalArgumentException("limit excceed: " + (position + len - origin)); this.position += len; return this; }
java
public final LogBuffer forward(final int len) { if (position + len > origin + limit) throw new IllegalArgumentException("limit excceed: " + (position + len - origin)); this.position += len; return this; }
[ "public", "final", "LogBuffer", "forward", "(", "final", "int", "len", ")", "{", "if", "(", "position", "+", "len", ">", "origin", "+", "limit", ")", "throw", "new", "IllegalArgumentException", "(", "\"limit excceed: \"", "+", "(", "position", "+", "len", ...
Forwards this buffer's position. @param len The forward distance @return This buffer
[ "Forwards", "this", "buffer", "s", "position", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L114-L120
124,710
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java
LogBuffer.consume
public final LogBuffer consume(final int len) { if (limit > len) { limit -= len; origin += len; position = origin; return this; } else if (limit == len) { limit = 0; origin = 0; position = 0; return...
java
public final LogBuffer consume(final int len) { if (limit > len) { limit -= len; origin += len; position = origin; return this; } else if (limit == len) { limit = 0; origin = 0; position = 0; return...
[ "public", "final", "LogBuffer", "consume", "(", "final", "int", "len", ")", "{", "if", "(", "limit", ">", "len", ")", "{", "limit", "-=", "len", ";", "origin", "+=", "len", ";", "position", "=", "origin", ";", "return", "this", ";", "}", "else", "i...
Consume this buffer, moving origin and position. @param len The consume distance @return This buffer
[ "Consume", "this", "buffer", "moving", "origin", "and", "position", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L128-L143
124,711
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java
LogBuffer.getInt8
public final int getInt8(final int pos) { if (pos >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: " + pos); return buffer[origin + pos]; }
java
public final int getInt8(final int pos) { if (pos >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: " + pos); return buffer[origin + pos]; }
[ "public", "final", "int", "getInt8", "(", "final", "int", "pos", ")", "{", "if", "(", "pos", ">=", "limit", "||", "pos", "<", "0", ")", "throw", "new", "IllegalArgumentException", "(", "\"limit excceed: \"", "+", "pos", ")", ";", "return", "buffer", "[",...
Return 8-bit signed int from buffer.
[ "Return", "8", "-", "bit", "signed", "int", "from", "buffer", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L207-L211
124,712
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java
LogBuffer.getUint8
public final int getUint8(final int pos) { if (pos >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: " + pos); return 0xff & buffer[origin + pos]; }
java
public final int getUint8(final int pos) { if (pos >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: " + pos); return 0xff & buffer[origin + pos]; }
[ "public", "final", "int", "getUint8", "(", "final", "int", "pos", ")", "{", "if", "(", "pos", ">=", "limit", "||", "pos", "<", "0", ")", "throw", "new", "IllegalArgumentException", "(", "\"limit excceed: \"", "+", "pos", ")", ";", "return", "0xff", "&", ...
Return 8-bit unsigned int from buffer.
[ "Return", "8", "-", "bit", "unsigned", "int", "from", "buffer", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L225-L229
124,713
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java
LogBuffer.getFixString
public final String getFixString(final int pos, final int len, String charsetName) { if (pos + len > limit || pos < 0) throw new IllegalArgumentException("limit excceed: " + (pos < 0 ? pos : (pos + len))); final int from =...
java
public final String getFixString(final int pos, final int len, String charsetName) { if (pos + len > limit || pos < 0) throw new IllegalArgumentException("limit excceed: " + (pos < 0 ? pos : (pos + len))); final int from =...
[ "public", "final", "String", "getFixString", "(", "final", "int", "pos", ",", "final", "int", "len", ",", "String", "charsetName", ")", "{", "if", "(", "pos", "+", "len", ">", "limit", "||", "pos", "<", "0", ")", "throw", "new", "IllegalArgumentException...
Return fix length string from buffer.
[ "Return", "fix", "length", "string", "from", "buffer", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L1061-L1077
124,714
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java
LogBuffer.getFixString
public final String getFixString(final int len, String charsetName) { if (position + len > origin + limit) throw new IllegalArgumentException("limit excceed: " + (position + len - origin)); final int from = position; ...
java
public final String getFixString(final int len, String charsetName) { if (position + len > origin + limit) throw new IllegalArgumentException("limit excceed: " + (position + len - origin)); final int from = position; ...
[ "public", "final", "String", "getFixString", "(", "final", "int", "len", ",", "String", "charsetName", ")", "{", "if", "(", "position", "+", "len", ">", "origin", "+", "limit", ")", "throw", "new", "IllegalArgumentException", "(", "\"limit excceed: \"", "+", ...
Return next fix length string from buffer.
[ "Return", "next", "fix", "length", "string", "from", "buffer", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L1082-L1100
124,715
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java
LogBuffer.getString
public final String getString(final int pos, String charsetName) { if (pos >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: " + pos); byte[] buf = buffer; final int len = (0xff & buf[origin + pos]); if (pos + len + 1 > limit) throw new IllegalArgumentExceptio...
java
public final String getString(final int pos, String charsetName) { if (pos >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: " + pos); byte[] buf = buffer; final int len = (0xff & buf[origin + pos]); if (pos + len + 1 > limit) throw new IllegalArgumentExceptio...
[ "public", "final", "String", "getString", "(", "final", "int", "pos", ",", "String", "charsetName", ")", "{", "if", "(", "pos", ">=", "limit", "||", "pos", "<", "0", ")", "throw", "new", "IllegalArgumentException", "(", "\"limit excceed: \"", "+", "pos", "...
Return dynamic length string from buffer.
[ "Return", "dynamic", "length", "string", "from", "buffer", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L1152-L1164
124,716
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java
LogBuffer.getString
public final String getString(String charsetName) { if (position >= origin + limit) throw new IllegalArgumentException("limit excceed: " + position); byte[] buf = buffer; final int len = (0xff & buf[position]); if (position + len + 1 > origin + limit) throw new IllegalArgumentExcep...
java
public final String getString(String charsetName) { if (position >= origin + limit) throw new IllegalArgumentException("limit excceed: " + position); byte[] buf = buffer; final int len = (0xff & buf[position]); if (position + len + 1 > origin + limit) throw new IllegalArgumentExcep...
[ "public", "final", "String", "getString", "(", "String", "charsetName", ")", "{", "if", "(", "position", ">=", "origin", "+", "limit", ")", "throw", "new", "IllegalArgumentException", "(", "\"limit excceed: \"", "+", "position", ")", ";", "byte", "[", "]", "...
Return next dynamic length string from buffer.
[ "Return", "next", "dynamic", "length", "string", "from", "buffer", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L1169-L1184
124,717
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java
RowsLogBuffer.nextOneRow
public final boolean nextOneRow(BitSet columns, boolean after) { final boolean hasOneRow = buffer.hasRemaining(); if (hasOneRow) { int column = 0; for (int i = 0; i < columnLen; i++) if (columns.get(i)) { column++; } ...
java
public final boolean nextOneRow(BitSet columns, boolean after) { final boolean hasOneRow = buffer.hasRemaining(); if (hasOneRow) { int column = 0; for (int i = 0; i < columnLen; i++) if (columns.get(i)) { column++; } ...
[ "public", "final", "boolean", "nextOneRow", "(", "BitSet", "columns", ",", "boolean", "after", ")", "{", "final", "boolean", "hasOneRow", "=", "buffer", ".", "hasRemaining", "(", ")", ";", "if", "(", "hasOneRow", ")", "{", "int", "column", "=", "0", ";",...
Extracting next row from packed buffer. @see mysql-5.1.60/sql/log_event.cc - Rows_log_event::print_verbose_one_row
[ "Extracting", "next", "row", "from", "packed", "buffer", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java#L70-L96
124,718
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java
RowsLogBuffer.mysqlToJavaType
static int mysqlToJavaType(int type, final int meta, boolean isBinary) { int javaType; if (type == LogEvent.MYSQL_TYPE_STRING) { if (meta >= 256) { int byte0 = meta >> 8; if ((byte0 & 0x30) != 0x30) { /* a long CHAR() field: see #37...
java
static int mysqlToJavaType(int type, final int meta, boolean isBinary) { int javaType; if (type == LogEvent.MYSQL_TYPE_STRING) { if (meta >= 256) { int byte0 = meta >> 8; if ((byte0 & 0x30) != 0x30) { /* a long CHAR() field: see #37...
[ "static", "int", "mysqlToJavaType", "(", "int", "type", ",", "final", "int", "meta", ",", "boolean", "isBinary", ")", "{", "int", "javaType", ";", "if", "(", "type", "==", "LogEvent", ".", "MYSQL_TYPE_STRING", ")", "{", "if", "(", "meta", ">=", "256", ...
Maps the given MySQL type to the correct JDBC type.
[ "Maps", "the", "given", "MySQL", "type", "to", "the", "correct", "JDBC", "type", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java#L132-L269
124,719
alibaba/canal
instance/core/src/main/java/com/alibaba/otter/canal/instance/core/AbstractCanalInstance.java
AbstractCanalInstance.afterStartEventParser
protected void afterStartEventParser(CanalEventParser eventParser) { // 读取一下历史订阅的filter信息 List<ClientIdentity> clientIdentitys = metaManager.listAllSubscribeInfo(destination); for (ClientIdentity clientIdentity : clientIdentitys) { subscribeChange(clientIdentity); } }
java
protected void afterStartEventParser(CanalEventParser eventParser) { // 读取一下历史订阅的filter信息 List<ClientIdentity> clientIdentitys = metaManager.listAllSubscribeInfo(destination); for (ClientIdentity clientIdentity : clientIdentitys) { subscribeChange(clientIdentity); } }
[ "protected", "void", "afterStartEventParser", "(", "CanalEventParser", "eventParser", ")", "{", "// 读取一下历史订阅的filter信息", "List", "<", "ClientIdentity", ">", "clientIdentitys", "=", "metaManager", ".", "listAllSubscribeInfo", "(", "destination", ")", ";", "for", "(", "C...
around event parser, default impl
[ "around", "event", "parser", "default", "impl" ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/instance/core/src/main/java/com/alibaba/otter/canal/instance/core/AbstractCanalInstance.java#L143-L149
124,720
alibaba/canal
client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/common/AbstractResource.java
AbstractResource.lastModified
@Override public long lastModified() throws IOException { long lastModified = getFileForLastModifiedCheck().lastModified(); if (lastModified == 0L) { throw new FileNotFoundException( getDescription() + " cannot be resolved in the file system for resolving its last-modifie...
java
@Override public long lastModified() throws IOException { long lastModified = getFileForLastModifiedCheck().lastModified(); if (lastModified == 0L) { throw new FileNotFoundException( getDescription() + " cannot be resolved in the file system for resolving its last-modifie...
[ "@", "Override", "public", "long", "lastModified", "(", ")", "throws", "IOException", "{", "long", "lastModified", "=", "getFileForLastModifiedCheck", "(", ")", ".", "lastModified", "(", ")", ";", "if", "(", "lastModified", "==", "0L", ")", "{", "throw", "ne...
This implementation checks the timestamp of the underlying File, if available. @see #getFileForLastModifiedCheck()
[ "This", "implementation", "checks", "the", "timestamp", "of", "the", "underlying", "File", "if", "available", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/common/AbstractResource.java#L130-L138
124,721
alibaba/canal
client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/common/AbstractResource.java
AbstractResource.createRelative
@Override public org.springframework.core.io.Resource createRelative(String relativePath) throws IOException { throw new FileNotFoundException("Cannot create a relative resource for " + getDescription()); }
java
@Override public org.springframework.core.io.Resource createRelative(String relativePath) throws IOException { throw new FileNotFoundException("Cannot create a relative resource for " + getDescription()); }
[ "@", "Override", "public", "org", ".", "springframework", ".", "core", ".", "io", ".", "Resource", "createRelative", "(", "String", "relativePath", ")", "throws", "IOException", "{", "throw", "new", "FileNotFoundException", "(", "\"Cannot create a relative resource fo...
This implementation throws a FileNotFoundException, assuming that relative resources cannot be created for this resource.
[ "This", "implementation", "throws", "a", "FileNotFoundException", "assuming", "that", "relative", "resources", "cannot", "be", "created", "for", "this", "resource", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/common/AbstractResource.java#L158-L161
124,722
alibaba/canal
client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/bind/RelaxedDataBinder.java
RelaxedDataBinder.setNameAliases
public void setNameAliases(Map<String, List<String>> aliases) { this.nameAliases = new LinkedMultiValueMap<String, String>(aliases); }
java
public void setNameAliases(Map<String, List<String>> aliases) { this.nameAliases = new LinkedMultiValueMap<String, String>(aliases); }
[ "public", "void", "setNameAliases", "(", "Map", "<", "String", ",", "List", "<", "String", ">", ">", "aliases", ")", "{", "this", ".", "nameAliases", "=", "new", "LinkedMultiValueMap", "<", "String", ",", "String", ">", "(", "aliases", ")", ";", "}" ]
Set name aliases. @param aliases a map of property name to aliases
[ "Set", "name", "aliases", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/bind/RelaxedDataBinder.java#L91-L93
124,723
alibaba/canal
driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/utils/ByteHelper.java
ByteHelper.readUnsignedIntLittleEndian
public static long readUnsignedIntLittleEndian(byte[] data, int index) { long result = (long) (data[index] & 0xFF) | (long) ((data[index + 1] & 0xFF) << 8) | (long) ((data[index + 2] & 0xFF) << 16) | (long) ((data[index + 3] & 0xFF) << 24); return result; }
java
public static long readUnsignedIntLittleEndian(byte[] data, int index) { long result = (long) (data[index] & 0xFF) | (long) ((data[index + 1] & 0xFF) << 8) | (long) ((data[index + 2] & 0xFF) << 16) | (long) ((data[index + 3] & 0xFF) << 24); return result; }
[ "public", "static", "long", "readUnsignedIntLittleEndian", "(", "byte", "[", "]", "data", ",", "int", "index", ")", "{", "long", "result", "=", "(", "long", ")", "(", "data", "[", "index", "]", "&", "0xFF", ")", "|", "(", "long", ")", "(", "(", "da...
Read 4 bytes in Little-endian byte order. @param data, the original byte array @param index, start to read from. @return
[ "Read", "4", "bytes", "in", "Little", "-", "endian", "byte", "order", "." ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/utils/ByteHelper.java#L45-L49
124,724
SeleniumHQ/selenium
java/server/src/org/openqa/selenium/grid/log/TerseFormatter.java
TerseFormatter.format
@Override public synchronized String format(final LogRecord record) { buffer.setLength(PREFIX.length()); buffer.append(timestampFormatter.format(new Date(record.getMillis()))); buffer.append(' '); buffer.append(levelNumberToCommonsLevelName(record.getLevel())); String[] parts = record.getSourceCla...
java
@Override public synchronized String format(final LogRecord record) { buffer.setLength(PREFIX.length()); buffer.append(timestampFormatter.format(new Date(record.getMillis()))); buffer.append(' '); buffer.append(levelNumberToCommonsLevelName(record.getLevel())); String[] parts = record.getSourceCla...
[ "@", "Override", "public", "synchronized", "String", "format", "(", "final", "LogRecord", "record", ")", "{", "buffer", ".", "setLength", "(", "PREFIX", ".", "length", "(", ")", ")", ";", "buffer", ".", "append", "(", "timestampFormatter", ".", "format", "...
Format the given log record and return the formatted string. @param record the log record to be formatted. @return a formatted log record
[ "Format", "the", "given", "log", "record", "and", "return", "the", "formatted", "string", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/selenium/grid/log/TerseFormatter.java#L75-L92
124,725
SeleniumHQ/selenium
java/client/src/com/thoughtworks/selenium/webdriven/JavascriptLibrary.java
JavascriptLibrary.getSeleniumScript
public String getSeleniumScript(String name) { String rawFunction = readScript(PREFIX + name); return String.format("function() { return (%s).apply(null, arguments);}", rawFunction); }
java
public String getSeleniumScript(String name) { String rawFunction = readScript(PREFIX + name); return String.format("function() { return (%s).apply(null, arguments);}", rawFunction); }
[ "public", "String", "getSeleniumScript", "(", "String", "name", ")", "{", "String", "rawFunction", "=", "readScript", "(", "PREFIX", "+", "name", ")", ";", "return", "String", ".", "format", "(", "\"function() { return (%s).apply(null, arguments);}\"", ",", "rawFunc...
Loads the named Selenium script and returns it wrapped in an anonymous function. @param name The script to load. @return The loaded script wrapped in an anonymous function.
[ "Loads", "the", "named", "Selenium", "script", "and", "returns", "it", "wrapped", "in", "an", "anonymous", "function", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/com/thoughtworks/selenium/webdriven/JavascriptLibrary.java#L51-L56
124,726
SeleniumHQ/selenium
java/server/src/org/openqa/grid/common/RegistrationRequest.java
RegistrationRequest.fromJson
public static RegistrationRequest fromJson(Map<String, Object> raw) throws JsonException { // If we could, we'd just get Json to coerce this for us, but that would lead to endless // recursion as the first thing it would do would be to call this very method. *sigh* Json json = new Json(); RegistrationRe...
java
public static RegistrationRequest fromJson(Map<String, Object> raw) throws JsonException { // If we could, we'd just get Json to coerce this for us, but that would lead to endless // recursion as the first thing it would do would be to call this very method. *sigh* Json json = new Json(); RegistrationRe...
[ "public", "static", "RegistrationRequest", "fromJson", "(", "Map", "<", "String", ",", "Object", ">", "raw", ")", "throws", "JsonException", "{", "// If we could, we'd just get Json to coerce this for us, but that would lead to endless", "// recursion as the first thing it would do...
Create an object from a registration request formatted as a json string.
[ "Create", "an", "object", "from", "a", "registration", "request", "formatted", "as", "a", "json", "string", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/common/RegistrationRequest.java#L119-L144
124,727
SeleniumHQ/selenium
java/server/src/org/openqa/grid/common/RegistrationRequest.java
RegistrationRequest.validate
public void validate() throws GridConfigurationException { // validations occur here in the getters called on the configuration. try { configuration.getHubHost(); configuration.getHubPort(); } catch (RuntimeException e) { throw new GridConfigurationException(e.getMessage()); } }
java
public void validate() throws GridConfigurationException { // validations occur here in the getters called on the configuration. try { configuration.getHubHost(); configuration.getHubPort(); } catch (RuntimeException e) { throw new GridConfigurationException(e.getMessage()); } }
[ "public", "void", "validate", "(", ")", "throws", "GridConfigurationException", "{", "// validations occur here in the getters called on the configuration.", "try", "{", "configuration", ".", "getHubHost", "(", ")", ";", "configuration", ".", "getHubPort", "(", ")", ";", ...
Validate the current setting and throw a config exception is an invalid setup is detected. @throws GridConfigurationException grid configuration
[ "Validate", "the", "current", "setting", "and", "throw", "a", "config", "exception", "is", "an", "invalid", "setup", "is", "detected", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/common/RegistrationRequest.java#L225-L233
124,728
SeleniumHQ/selenium
java/server/src/org/openqa/grid/web/servlet/handler/RequestHandler.java
RequestHandler.forwardNewSessionRequestAndUpdateRegistry
public void forwardNewSessionRequestAndUpdateRegistry(TestSession session) throws NewSessionException { try (NewSessionPayload payload = NewSessionPayload.create( ImmutableMap.of("desiredCapabilities", session.getRequestedCapabilities()))) { StringBuilder json = new StringBuilder(); payloa...
java
public void forwardNewSessionRequestAndUpdateRegistry(TestSession session) throws NewSessionException { try (NewSessionPayload payload = NewSessionPayload.create( ImmutableMap.of("desiredCapabilities", session.getRequestedCapabilities()))) { StringBuilder json = new StringBuilder(); payloa...
[ "public", "void", "forwardNewSessionRequestAndUpdateRegistry", "(", "TestSession", "session", ")", "throws", "NewSessionException", "{", "try", "(", "NewSessionPayload", "payload", "=", "NewSessionPayload", ".", "create", "(", "ImmutableMap", ".", "of", "(", "\"desiredC...
Forward the new session request to the TestSession that has been assigned, and parse the response to extract and return the external key assigned by the remote. @param session session @throws NewSessionException in case anything wrong happens during the new session process.
[ "Forward", "the", "new", "session", "request", "to", "the", "TestSession", "that", "has", "been", "assigned", "and", "parse", "the", "response", "to", "extract", "and", "return", "the", "external", "key", "assigned", "by", "the", "remote", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/web/servlet/handler/RequestHandler.java#L84-L96
124,729
SeleniumHQ/selenium
java/server/src/org/openqa/grid/web/servlet/handler/RequestHandler.java
RequestHandler.beforeSessionEvent
private void beforeSessionEvent() throws NewSessionException { RemoteProxy p = session.getSlot().getProxy(); if (p instanceof TestSessionListener) { try { ((TestSessionListener) p).beforeSession(session); } catch (Exception e) { log.severe("Error running the beforeSessionListener : "...
java
private void beforeSessionEvent() throws NewSessionException { RemoteProxy p = session.getSlot().getProxy(); if (p instanceof TestSessionListener) { try { ((TestSessionListener) p).beforeSession(session); } catch (Exception e) { log.severe("Error running the beforeSessionListener : "...
[ "private", "void", "beforeSessionEvent", "(", ")", "throws", "NewSessionException", "{", "RemoteProxy", "p", "=", "session", ".", "getSlot", "(", ")", ".", "getProxy", "(", ")", ";", "if", "(", "p", "instanceof", "TestSessionListener", ")", "{", "try", "{", ...
calls the TestSessionListener is the proxy for that node has one specified. @throws NewSessionException in case anything goes wrong with the listener.
[ "calls", "the", "TestSessionListener", "is", "the", "proxy", "for", "that", "node", "has", "one", "specified", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/web/servlet/handler/RequestHandler.java#L169-L180
124,730
SeleniumHQ/selenium
java/server/src/org/openqa/grid/web/servlet/handler/RequestHandler.java
RequestHandler.waitForSessionBound
public void waitForSessionBound() throws InterruptedException, TimeoutException { // Maintain compatibility with Grid 1.x, which had the ability to // specify how long to wait before canceling a request. GridHubConfiguration configuration = getRegistry().getHub().getConfiguration(); Integer newSessionWa...
java
public void waitForSessionBound() throws InterruptedException, TimeoutException { // Maintain compatibility with Grid 1.x, which had the ability to // specify how long to wait before canceling a request. GridHubConfiguration configuration = getRegistry().getHub().getConfiguration(); Integer newSessionWa...
[ "public", "void", "waitForSessionBound", "(", ")", "throws", "InterruptedException", ",", "TimeoutException", "{", "// Maintain compatibility with Grid 1.x, which had the ability to", "// specify how long to wait before canceling a request.", "GridHubConfiguration", "configuration", "=",...
wait for the registry to match the request with a TestSlot. @throws InterruptedException Interrupted exception @throws TimeoutException if the request reaches the new session wait timeout before being assigned.
[ "wait", "for", "the", "registry", "to", "match", "the", "request", "with", "a", "TestSlot", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/web/servlet/handler/RequestHandler.java#L189-L203
124,731
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.titleIs
public static ExpectedCondition<Boolean> titleIs(final String title) { return new ExpectedCondition<Boolean>() { private String currentTitle = ""; @Override public Boolean apply(WebDriver driver) { currentTitle = driver.getTitle(); return title.equals(currentTitle); } ...
java
public static ExpectedCondition<Boolean> titleIs(final String title) { return new ExpectedCondition<Boolean>() { private String currentTitle = ""; @Override public Boolean apply(WebDriver driver) { currentTitle = driver.getTitle(); return title.equals(currentTitle); } ...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "titleIs", "(", "final", "String", "title", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "private", "String", "currentTitle", "=", "\"\"", ";", "@", "Overrid...
An expectation for checking the title of a page. @param title the expected title, which must be an exact match @return true when the title matches, false otherwise
[ "An", "expectation", "for", "checking", "the", "title", "of", "a", "page", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L57-L72
124,732
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.titleContains
public static ExpectedCondition<Boolean> titleContains(final String title) { return new ExpectedCondition<Boolean>() { private String currentTitle = ""; @Override public Boolean apply(WebDriver driver) { currentTitle = driver.getTitle(); return currentTitle != null && currentTitle...
java
public static ExpectedCondition<Boolean> titleContains(final String title) { return new ExpectedCondition<Boolean>() { private String currentTitle = ""; @Override public Boolean apply(WebDriver driver) { currentTitle = driver.getTitle(); return currentTitle != null && currentTitle...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "titleContains", "(", "final", "String", "title", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "private", "String", "currentTitle", "=", "\"\"", ";", "@", "O...
An expectation for checking that the title contains a case-sensitive substring @param title the fragment of title expected @return true when the title matches, false otherwise
[ "An", "expectation", "for", "checking", "that", "the", "title", "contains", "a", "case", "-", "sensitive", "substring" ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L80-L95
124,733
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.urlToBe
public static ExpectedCondition<Boolean> urlToBe(final String url) { return new ExpectedCondition<Boolean>() { private String currentUrl = ""; @Override public Boolean apply(WebDriver driver) { currentUrl = driver.getCurrentUrl(); return currentUrl != null && currentUrl.equals(url...
java
public static ExpectedCondition<Boolean> urlToBe(final String url) { return new ExpectedCondition<Boolean>() { private String currentUrl = ""; @Override public Boolean apply(WebDriver driver) { currentUrl = driver.getCurrentUrl(); return currentUrl != null && currentUrl.equals(url...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "urlToBe", "(", "final", "String", "url", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "private", "String", "currentUrl", "=", "\"\"", ";", "@", "Override", ...
An expectation for the URL of the current page to be a specific url. @param url the url that the page should be on @return <code>true</code> when the URL is what it should be
[ "An", "expectation", "for", "the", "URL", "of", "the", "current", "page", "to", "be", "a", "specific", "url", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L103-L118
124,734
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.urlContains
public static ExpectedCondition<Boolean> urlContains(final String fraction) { return new ExpectedCondition<Boolean>() { private String currentUrl = ""; @Override public Boolean apply(WebDriver driver) { currentUrl = driver.getCurrentUrl(); return currentUrl != null && currentUrl.c...
java
public static ExpectedCondition<Boolean> urlContains(final String fraction) { return new ExpectedCondition<Boolean>() { private String currentUrl = ""; @Override public Boolean apply(WebDriver driver) { currentUrl = driver.getCurrentUrl(); return currentUrl != null && currentUrl.c...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "urlContains", "(", "final", "String", "fraction", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "private", "String", "currentUrl", "=", "\"\"", ";", "@", "Ov...
An expectation for the URL of the current page to contain specific text. @param fraction the fraction of the url that the page should be on @return <code>true</code> when the URL contains the text
[ "An", "expectation", "for", "the", "URL", "of", "the", "current", "page", "to", "contain", "specific", "text", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L126-L141
124,735
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.urlMatches
public static ExpectedCondition<Boolean> urlMatches(final String regex) { return new ExpectedCondition<Boolean>() { private String currentUrl; private Pattern pattern; private Matcher matcher; @Override public Boolean apply(WebDriver driver) { currentUrl = driver.getCurrentUrl...
java
public static ExpectedCondition<Boolean> urlMatches(final String regex) { return new ExpectedCondition<Boolean>() { private String currentUrl; private Pattern pattern; private Matcher matcher; @Override public Boolean apply(WebDriver driver) { currentUrl = driver.getCurrentUrl...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "urlMatches", "(", "final", "String", "regex", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "private", "String", "currentUrl", ";", "private", "Pattern", "patt...
Expectation for the URL to match a specific regular expression @param regex the regular expression that the URL should match @return <code>true</code> if the URL matches the specified regular expression
[ "Expectation", "for", "the", "URL", "to", "match", "a", "specific", "regular", "expression" ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L149-L169
124,736
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.presenceOfElementLocated
public static ExpectedCondition<WebElement> presenceOfElementLocated(final By locator) { return new ExpectedCondition<WebElement>() { @Override public WebElement apply(WebDriver driver) { return driver.findElement(locator); } @Override public String toString() { return...
java
public static ExpectedCondition<WebElement> presenceOfElementLocated(final By locator) { return new ExpectedCondition<WebElement>() { @Override public WebElement apply(WebDriver driver) { return driver.findElement(locator); } @Override public String toString() { return...
[ "public", "static", "ExpectedCondition", "<", "WebElement", ">", "presenceOfElementLocated", "(", "final", "By", "locator", ")", "{", "return", "new", "ExpectedCondition", "<", "WebElement", ">", "(", ")", "{", "@", "Override", "public", "WebElement", "apply", "...
An expectation for checking that an element is present on the DOM of a page. This does not necessarily mean that the element is visible. @param locator used to find the element @return the WebElement once it is located
[ "An", "expectation", "for", "checking", "that", "an", "element", "is", "present", "on", "the", "DOM", "of", "a", "page", ".", "This", "does", "not", "necessarily", "mean", "that", "the", "element", "is", "visible", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L178-L190
124,737
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.visibilityOfElementLocated
public static ExpectedCondition<WebElement> visibilityOfElementLocated(final By locator) { return new ExpectedCondition<WebElement>() { @Override public WebElement apply(WebDriver driver) { try { return elementIfVisible(driver.findElement(locator)); } catch (StaleElementReferen...
java
public static ExpectedCondition<WebElement> visibilityOfElementLocated(final By locator) { return new ExpectedCondition<WebElement>() { @Override public WebElement apply(WebDriver driver) { try { return elementIfVisible(driver.findElement(locator)); } catch (StaleElementReferen...
[ "public", "static", "ExpectedCondition", "<", "WebElement", ">", "visibilityOfElementLocated", "(", "final", "By", "locator", ")", "{", "return", "new", "ExpectedCondition", "<", "WebElement", ">", "(", ")", "{", "@", "Override", "public", "WebElement", "apply", ...
An expectation for checking that an element is present on the DOM of a page and visible. Visibility means that the element is not only displayed but also has a height and width that is greater than 0. @param locator used to find the element @return the WebElement once it is located and visible
[ "An", "expectation", "for", "checking", "that", "an", "element", "is", "present", "on", "the", "DOM", "of", "a", "page", "and", "visible", ".", "Visibility", "means", "that", "the", "element", "is", "not", "only", "displayed", "but", "also", "has", "a", ...
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L200-L216
124,738
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.visibilityOf
public static ExpectedCondition<WebElement> visibilityOf(final WebElement element) { return new ExpectedCondition<WebElement>() { @Override public WebElement apply(WebDriver driver) { return elementIfVisible(element); } @Override public String toString() { return "visi...
java
public static ExpectedCondition<WebElement> visibilityOf(final WebElement element) { return new ExpectedCondition<WebElement>() { @Override public WebElement apply(WebDriver driver) { return elementIfVisible(element); } @Override public String toString() { return "visi...
[ "public", "static", "ExpectedCondition", "<", "WebElement", ">", "visibilityOf", "(", "final", "WebElement", "element", ")", "{", "return", "new", "ExpectedCondition", "<", "WebElement", ">", "(", ")", "{", "@", "Override", "public", "WebElement", "apply", "(", ...
An expectation for checking that an element, known to be present on the DOM of a page, is visible. Visibility means that the element is not only displayed but also has a height and width that is greater than 0. @param element the WebElement @return the (same) WebElement once it is visible
[ "An", "expectation", "for", "checking", "that", "an", "element", "known", "to", "be", "present", "on", "the", "DOM", "of", "a", "page", "is", "visible", ".", "Visibility", "means", "that", "the", "element", "is", "not", "only", "displayed", "but", "also", ...
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L296-L308
124,739
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.presenceOfAllElementsLocatedBy
public static ExpectedCondition<List<WebElement>> presenceOfAllElementsLocatedBy( final By locator) { return new ExpectedCondition<List<WebElement>>() { @Override public List<WebElement> apply(WebDriver driver) { List<WebElement> elements = driver.findElements(locator); return elemen...
java
public static ExpectedCondition<List<WebElement>> presenceOfAllElementsLocatedBy( final By locator) { return new ExpectedCondition<List<WebElement>>() { @Override public List<WebElement> apply(WebDriver driver) { List<WebElement> elements = driver.findElements(locator); return elemen...
[ "public", "static", "ExpectedCondition", "<", "List", "<", "WebElement", ">", ">", "presenceOfAllElementsLocatedBy", "(", "final", "By", "locator", ")", "{", "return", "new", "ExpectedCondition", "<", "List", "<", "WebElement", ">", ">", "(", ")", "{", "@", ...
An expectation for checking that there is at least one element present on a web page. @param locator used to find the element @return the list of WebElements once they are located
[ "An", "expectation", "for", "checking", "that", "there", "is", "at", "least", "one", "element", "present", "on", "a", "web", "page", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L323-L337
124,740
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.textToBePresentInElement
public static ExpectedCondition<Boolean> textToBePresentInElement(final WebElement element, final String text) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { try { Strin...
java
public static ExpectedCondition<Boolean> textToBePresentInElement(final WebElement element, final String text) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { try { Strin...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "textToBePresentInElement", "(", "final", "WebElement", "element", ",", "final", "String", "text", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "@", "Override", ...
An expectation for checking if the given text is present in the specified element. @param element the WebElement @param text to be present in the element @return true once the element contains the given text
[ "An", "expectation", "for", "checking", "if", "the", "given", "text", "is", "present", "in", "the", "specified", "element", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L346-L365
124,741
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.textToBePresentInElementLocated
public static ExpectedCondition<Boolean> textToBePresentInElementLocated(final By locator, final String text) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { try { ...
java
public static ExpectedCondition<Boolean> textToBePresentInElementLocated(final By locator, final String text) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { try { ...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "textToBePresentInElementLocated", "(", "final", "By", "locator", ",", "final", "String", "text", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "@", "Override", ...
An expectation for checking if the given text is present in the element that matches the given locator. @param locator used to find the element @param text to be present in the element found by the locator @return true once the first element located by locator contains the given text
[ "An", "expectation", "for", "checking", "if", "the", "given", "text", "is", "present", "in", "the", "element", "that", "matches", "the", "given", "locator", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L375-L395
124,742
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.invisibilityOfElementLocated
public static ExpectedCondition<Boolean> invisibilityOfElementLocated(final By locator) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { try { return !(driver.findElement(locator).isDisplayed()); } catch (NoSuchElementException e) {...
java
public static ExpectedCondition<Boolean> invisibilityOfElementLocated(final By locator) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { try { return !(driver.findElement(locator).isDisplayed()); } catch (NoSuchElementException e) {...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "invisibilityOfElementLocated", "(", "final", "By", "locator", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "@", "Override", "public", "Boolean", "apply", "(", ...
An expectation for checking that an element is either invisible or not present on the DOM. @param locator used to find the element @return true if the element is not displayed or the element doesn't exist or stale element
[ "An", "expectation", "for", "checking", "that", "an", "element", "is", "either", "invisible", "or", "not", "present", "on", "the", "DOM", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L572-L594
124,743
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.invisibilityOfElementWithText
public static ExpectedCondition<Boolean> invisibilityOfElementWithText(final By locator, final String text) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { try { retu...
java
public static ExpectedCondition<Boolean> invisibilityOfElementWithText(final By locator, final String text) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { try { retu...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "invisibilityOfElementWithText", "(", "final", "By", "locator", ",", "final", "String", "text", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "@", "Override", "...
An expectation for checking that an element with text is either invisible or not present on the DOM. @param locator used to find the element @param text of the element @return true if no such element, stale element or displayed text not equal that provided
[ "An", "expectation", "for", "checking", "that", "an", "element", "with", "text", "is", "either", "invisible", "or", "not", "present", "on", "the", "DOM", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L604-L629
124,744
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.stalenessOf
public static ExpectedCondition<Boolean> stalenessOf(final WebElement element) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver ignored) { try { // Calling any method forces a staleness check element.isEnabled(); return false; ...
java
public static ExpectedCondition<Boolean> stalenessOf(final WebElement element) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver ignored) { try { // Calling any method forces a staleness check element.isEnabled(); return false; ...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "stalenessOf", "(", "final", "WebElement", "element", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "@", "Override", "public", "Boolean", "apply", "(", "WebDriv...
Wait until an element is no longer attached to the DOM. @param element The element to wait for. @return false if the element is still attached to the DOM, true otherwise.
[ "Wait", "until", "an", "element", "is", "no", "longer", "attached", "to", "the", "DOM", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L694-L712
124,745
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.refreshed
public static <T> ExpectedCondition<T> refreshed(final ExpectedCondition<T> condition) { return new ExpectedCondition<T>() { @Override public T apply(WebDriver driver) { try { return condition.apply(driver); } catch (StaleElementReferenceException e) { return null; ...
java
public static <T> ExpectedCondition<T> refreshed(final ExpectedCondition<T> condition) { return new ExpectedCondition<T>() { @Override public T apply(WebDriver driver) { try { return condition.apply(driver); } catch (StaleElementReferenceException e) { return null; ...
[ "public", "static", "<", "T", ">", "ExpectedCondition", "<", "T", ">", "refreshed", "(", "final", "ExpectedCondition", "<", "T", ">", "condition", ")", "{", "return", "new", "ExpectedCondition", "<", "T", ">", "(", ")", "{", "@", "Override", "public", "T...
Wrapper for a condition, which allows for elements to update by redrawing. This works around the problem of conditions which have two parts: find an element and then check for some condition on it. For these conditions it is possible that an element is located and then subsequently it is redrawn on the client. When th...
[ "Wrapper", "for", "a", "condition", "which", "allows", "for", "elements", "to", "update", "by", "redrawing", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L726-L742
124,746
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.elementSelectionStateToBe
public static ExpectedCondition<Boolean> elementSelectionStateToBe(final WebElement element, final boolean selected) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { return element....
java
public static ExpectedCondition<Boolean> elementSelectionStateToBe(final WebElement element, final boolean selected) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { return element....
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "elementSelectionStateToBe", "(", "final", "WebElement", "element", ",", "final", "boolean", "selected", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "@", "Overr...
An expectation for checking if the given element is selected. @param element WebElement to be selected @param selected boolean state of the selection state of the element @return true once the element's selection stated is that of selected
[ "An", "expectation", "for", "checking", "if", "the", "given", "element", "is", "selected", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L761-L774
124,747
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.not
public static ExpectedCondition<Boolean> not(final ExpectedCondition<?> condition) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { Object result = condition.apply(driver); return result == null || result.equals(Boolean.FALSE); } ...
java
public static ExpectedCondition<Boolean> not(final ExpectedCondition<?> condition) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { Object result = condition.apply(driver); return result == null || result.equals(Boolean.FALSE); } ...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "not", "(", "final", "ExpectedCondition", "<", "?", ">", "condition", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "@", "Override", "public", "Boolean", "app...
An expectation with the logical opposite condition of the given condition. Note that if the Condition you are inverting throws an exception that is caught by the Ignored Exceptions, the inversion will not take place and lead to confusing results. @param condition ExpectedCondition to be inverted @return true once the...
[ "An", "expectation", "with", "the", "logical", "opposite", "condition", "of", "the", "given", "condition", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L846-L859
124,748
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.attributeToBe
public static ExpectedCondition<Boolean> attributeToBe(final By locator, final String attribute, final String value) { return new ExpectedCondition<Boolean>() { private String currentValue = null; @Override public Boolean apply(WebDriver dr...
java
public static ExpectedCondition<Boolean> attributeToBe(final By locator, final String attribute, final String value) { return new ExpectedCondition<Boolean>() { private String currentValue = null; @Override public Boolean apply(WebDriver dr...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "attributeToBe", "(", "final", "By", "locator", ",", "final", "String", "attribute", ",", "final", "String", "value", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", ...
An expectation for checking WebElement with given locator has attribute with a specific value @param locator used to find the element @param attribute used to define css or html attribute @param value used as expected attribute value @return Boolean true when element has css or html attribute with the value
[ "An", "expectation", "for", "checking", "WebElement", "with", "given", "locator", "has", "attribute", "with", "a", "specific", "value" ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L870-L891
124,749
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.textToBe
public static ExpectedCondition<Boolean> textToBe(final By locator, final String value) { return new ExpectedCondition<Boolean>() { private String currentValue = null; @Override public Boolean apply(WebDriver driver) { try { currentValue = driver.findElement(locator).getText(); ...
java
public static ExpectedCondition<Boolean> textToBe(final By locator, final String value) { return new ExpectedCondition<Boolean>() { private String currentValue = null; @Override public Boolean apply(WebDriver driver) { try { currentValue = driver.findElement(locator).getText(); ...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "textToBe", "(", "final", "By", "locator", ",", "final", "String", "value", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "private", "String", "currentValue", ...
An expectation for checking WebElement with given locator has specific text @param locator used to find the element @param value used as expected text @return Boolean true when element has text value equal to @value
[ "An", "expectation", "for", "checking", "WebElement", "with", "given", "locator", "has", "specific", "text" ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L900-L920
124,750
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.textMatches
public static ExpectedCondition<Boolean> textMatches(final By locator, final Pattern pattern) { return new ExpectedCondition<Boolean>() { private String currentValue = null; @Override public Boolean apply(WebDriver driver) { try { currentValue = driver.findElement(locator).getTe...
java
public static ExpectedCondition<Boolean> textMatches(final By locator, final Pattern pattern) { return new ExpectedCondition<Boolean>() { private String currentValue = null; @Override public Boolean apply(WebDriver driver) { try { currentValue = driver.findElement(locator).getTe...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "textMatches", "(", "final", "By", "locator", ",", "final", "Pattern", "pattern", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "private", "String", "currentVal...
An expectation for checking WebElement with given locator has text with a value as a part of it @param locator used to find the element @param pattern used as expected text matcher pattern @return Boolean true when element has text value containing @value
[ "An", "expectation", "for", "checking", "WebElement", "with", "given", "locator", "has", "text", "with", "a", "value", "as", "a", "part", "of", "it" ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L930-L951
124,751
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.numberOfElementsToBeMoreThan
public static ExpectedCondition<List<WebElement>> numberOfElementsToBeMoreThan(final By locator, final Integer number) { return new ExpectedCondition<List<WebElement>>() { private Integer currentNumber = 0; @Override ...
java
public static ExpectedCondition<List<WebElement>> numberOfElementsToBeMoreThan(final By locator, final Integer number) { return new ExpectedCondition<List<WebElement>>() { private Integer currentNumber = 0; @Override ...
[ "public", "static", "ExpectedCondition", "<", "List", "<", "WebElement", ">", ">", "numberOfElementsToBeMoreThan", "(", "final", "By", "locator", ",", "final", "Integer", "number", ")", "{", "return", "new", "ExpectedCondition", "<", "List", "<", "WebElement", "...
An expectation for checking number of WebElements with given locator being more than defined number @param locator used to find the element @param number used to define minimum number of elements @return Boolean true when size of elements list is more than defined
[ "An", "expectation", "for", "checking", "number", "of", "WebElements", "with", "given", "locator", "being", "more", "than", "defined", "number" ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L960-L978
124,752
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.attributeContains
public static ExpectedCondition<Boolean> attributeContains(final WebElement element, final String attribute, final String value) { return new ExpectedCondition<Boolean>() { private String ...
java
public static ExpectedCondition<Boolean> attributeContains(final WebElement element, final String attribute, final String value) { return new ExpectedCondition<Boolean>() { private String ...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "attributeContains", "(", "final", "WebElement", "element", ",", "final", "String", "attribute", ",", "final", "String", "value", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "...
An expectation for checking WebElement with given locator has attribute which contains specific value @param element used to check its parameters @param attribute used to define css or html attribute @param value used as expected attribute value @return Boolean true when element has css or html attribute which c...
[ "An", "expectation", "for", "checking", "WebElement", "with", "given", "locator", "has", "attribute", "which", "contains", "specific", "value" ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L1076-L1094
124,753
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.attributeToBeNotEmpty
public static ExpectedCondition<Boolean> attributeToBeNotEmpty(final WebElement element, final String attribute) { return driver -> getAttributeOrCssValue(element, attribute).isPresent(); }
java
public static ExpectedCondition<Boolean> attributeToBeNotEmpty(final WebElement element, final String attribute) { return driver -> getAttributeOrCssValue(element, attribute).isPresent(); }
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "attributeToBeNotEmpty", "(", "final", "WebElement", "element", ",", "final", "String", "attribute", ")", "{", "return", "driver", "->", "getAttributeOrCssValue", "(", "element", ",", "attribute", ")", ...
An expectation for checking WebElement any non empty value for given attribute @param element used to check its parameters @param attribute used to define css or html attribute @return Boolean true when element has css or html attribute with non empty value
[ "An", "expectation", "for", "checking", "WebElement", "any", "non", "empty", "value", "for", "given", "attribute" ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L1133-L1136
124,754
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.presenceOfNestedElementLocatedBy
public static ExpectedCondition<WebElement> presenceOfNestedElementLocatedBy( final WebElement element, final By childLocator) { return new ExpectedCondition<WebElement>() { @Override public WebElement apply(WebDriver webDriver) { return element.findElement(childLocator); } ...
java
public static ExpectedCondition<WebElement> presenceOfNestedElementLocatedBy( final WebElement element, final By childLocator) { return new ExpectedCondition<WebElement>() { @Override public WebElement apply(WebDriver webDriver) { return element.findElement(childLocator); } ...
[ "public", "static", "ExpectedCondition", "<", "WebElement", ">", "presenceOfNestedElementLocatedBy", "(", "final", "WebElement", "element", ",", "final", "By", "childLocator", ")", "{", "return", "new", "ExpectedCondition", "<", "WebElement", ">", "(", ")", "{", "...
An expectation for checking child WebElement as a part of parent element to be present @param element used as parent element @param childLocator used to find child element. For example td By.xpath("./tr/td") @return subelement
[ "An", "expectation", "for", "checking", "child", "WebElement", "as", "a", "part", "of", "parent", "element", "to", "be", "present" ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L1247-L1263
124,755
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.invisibilityOfAllElements
public static ExpectedCondition<Boolean> invisibilityOfAllElements( final List<WebElement> elements) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver webDriver) { return elements.stream().allMatch(ExpectedConditions::isInvisible); } @Override...
java
public static ExpectedCondition<Boolean> invisibilityOfAllElements( final List<WebElement> elements) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver webDriver) { return elements.stream().allMatch(ExpectedConditions::isInvisible); } @Override...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "invisibilityOfAllElements", "(", "final", "List", "<", "WebElement", ">", "elements", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "@", "Override", "public", ...
An expectation for checking all elements from given list to be invisible @param elements used to check their invisibility @return Boolean true when all elements are not visible anymore
[ "An", "expectation", "for", "checking", "all", "elements", "from", "given", "list", "to", "be", "invisible" ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L1309-L1323
124,756
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.invisibilityOf
public static ExpectedCondition<Boolean> invisibilityOf(final WebElement element) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver webDriver) { return isInvisible(element); } @Override public String toString() { return "invisibility...
java
public static ExpectedCondition<Boolean> invisibilityOf(final WebElement element) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver webDriver) { return isInvisible(element); } @Override public String toString() { return "invisibility...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "invisibilityOf", "(", "final", "WebElement", "element", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "@", "Override", "public", "Boolean", "apply", "(", "WebD...
An expectation for checking the element to be invisible @param element used to check its invisibility @return Boolean true when elements is not visible anymore
[ "An", "expectation", "for", "checking", "the", "element", "to", "be", "invisible" ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L1331-L1344
124,757
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.or
public static ExpectedCondition<Boolean> or(final ExpectedCondition<?>... conditions) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { RuntimeException lastException = null; for (ExpectedCondition<?> condition : conditions) { try { ...
java
public static ExpectedCondition<Boolean> or(final ExpectedCondition<?>... conditions) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { RuntimeException lastException = null; for (ExpectedCondition<?> condition : conditions) { try { ...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "or", "(", "final", "ExpectedCondition", "<", "?", ">", "...", "conditions", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "@", "Override", "public", "Boolean...
An expectation with the logical or condition of the given list of conditions. Each condition is checked until at least one of them returns true or not null. @param conditions ExpectedCondition is a list of alternative conditions @return true once one of conditions is satisfied
[ "An", "expectation", "with", "the", "logical", "or", "condition", "of", "the", "given", "list", "of", "conditions", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L1363-L1397
124,758
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.and
public static ExpectedCondition<Boolean> and(final ExpectedCondition<?>... conditions) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { for (ExpectedCondition<?> condition : conditions) { Object result = condition.apply(driver); ...
java
public static ExpectedCondition<Boolean> and(final ExpectedCondition<?>... conditions) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { for (ExpectedCondition<?> condition : conditions) { Object result = condition.apply(driver); ...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "and", "(", "final", "ExpectedCondition", "<", "?", ">", "...", "conditions", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "@", "Override", "public", "Boolea...
An expectation with the logical and condition of the given list of conditions. Each condition is checked until all of them return true or not null @param conditions ExpectedCondition is a list of alternative conditions @return true once all conditions are satisfied
[ "An", "expectation", "with", "the", "logical", "and", "condition", "of", "the", "given", "list", "of", "conditions", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L1408-L1435
124,759
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.javaScriptThrowsNoExceptions
public static ExpectedCondition<Boolean> javaScriptThrowsNoExceptions(final String javaScript) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { try { ((JavascriptExecutor) driver).executeScript(javaScript); return true; } ...
java
public static ExpectedCondition<Boolean> javaScriptThrowsNoExceptions(final String javaScript) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { try { ((JavascriptExecutor) driver).executeScript(javaScript); return true; } ...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "javaScriptThrowsNoExceptions", "(", "final", "String", "javaScript", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "@", "Override", "public", "Boolean", "apply", ...
An expectation to check if js executable. Useful when you know that there should be a Javascript value or something at the stage. @param javaScript used as executable script @return true once javaScript executed without errors
[ "An", "expectation", "to", "check", "if", "js", "executable", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L1446-L1463
124,760
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.jsReturnsValue
public static ExpectedCondition<Object> jsReturnsValue(final String javaScript) { return new ExpectedCondition<Object>() { @Override public Object apply(WebDriver driver) { try { Object value = ((JavascriptExecutor) driver).executeScript(javaScript); if (value instanceof Lis...
java
public static ExpectedCondition<Object> jsReturnsValue(final String javaScript) { return new ExpectedCondition<Object>() { @Override public Object apply(WebDriver driver) { try { Object value = ((JavascriptExecutor) driver).executeScript(javaScript); if (value instanceof Lis...
[ "public", "static", "ExpectedCondition", "<", "Object", ">", "jsReturnsValue", "(", "final", "String", "javaScript", ")", "{", "return", "new", "ExpectedCondition", "<", "Object", ">", "(", ")", "{", "@", "Override", "public", "Object", "apply", "(", "WebDrive...
An expectation for String value from javascript @param javaScript as executable js line @return true once js return string
[ "An", "expectation", "for", "String", "value", "from", "javascript" ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L1471-L1496
124,761
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/UnhandledAlertException.java
UnhandledAlertException.getAlert
@Beta public Map<String, String> getAlert() { HashMap<String, String> toReturn = new HashMap<>(); toReturn.put("text", getAlertText()); return Collections.unmodifiableMap(toReturn); }
java
@Beta public Map<String, String> getAlert() { HashMap<String, String> toReturn = new HashMap<>(); toReturn.put("text", getAlertText()); return Collections.unmodifiableMap(toReturn); }
[ "@", "Beta", "public", "Map", "<", "String", ",", "String", ">", "getAlert", "(", ")", "{", "HashMap", "<", "String", ",", "String", ">", "toReturn", "=", "new", "HashMap", "<>", "(", ")", ";", "toReturn", ".", "put", "(", "\"text\"", ",", "getAlertT...
Used for serialising. Some of the drivers return the alert text like this.
[ "Used", "for", "serialising", ".", "Some", "of", "the", "drivers", "return", "the", "alert", "text", "like", "this", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/UnhandledAlertException.java#L45-L50
124,762
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/Quotes.java
Quotes.escape
@SuppressWarnings("JavaDoc") public static String escape(String toEscape) { if (toEscape.contains("\"") && toEscape.contains("'")) { boolean quoteIsLast = false; if (toEscape.lastIndexOf("\"") == toEscape.length() - 1) { quoteIsLast = true; } String[] substringsWithoutQuotes = toEs...
java
@SuppressWarnings("JavaDoc") public static String escape(String toEscape) { if (toEscape.contains("\"") && toEscape.contains("'")) { boolean quoteIsLast = false; if (toEscape.lastIndexOf("\"") == toEscape.length() - 1) { quoteIsLast = true; } String[] substringsWithoutQuotes = toEs...
[ "@", "SuppressWarnings", "(", "\"JavaDoc\"", ")", "public", "static", "String", "escape", "(", "String", "toEscape", ")", "{", "if", "(", "toEscape", ".", "contains", "(", "\"\\\"\"", ")", "&&", "toEscape", ".", "contains", "(", "\"'\"", ")", ")", "{", "...
Convert strings with both quotes and ticks into a valid xpath component For example, <p> {@code foo} will be converted to {@code "foo"}, </p> <p> {@code f"oo} will be converted to {@code 'f"oo'}, </p> <p> {@code foo'"bar} will be converted to {@code concat("foo'", '"', "bar")} </p> @param toEscape a text to escape q...
[ "Convert", "strings", "with", "both", "quotes", "and", "ticks", "into", "a", "valid", "xpath", "component" ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/Quotes.java#L40-L66
124,763
SeleniumHQ/selenium
java/server/src/org/openqa/grid/internal/BaseRemoteProxy.java
BaseRemoteProxy.getNewInstance
@SuppressWarnings("unchecked") public static <T extends RemoteProxy> T getNewInstance( RegistrationRequest request, GridRegistry registry) { try { String proxyClass = request.getConfiguration().proxy; if (proxyClass == null) { log.fine("No proxy class. Using default"); proxyClass...
java
@SuppressWarnings("unchecked") public static <T extends RemoteProxy> T getNewInstance( RegistrationRequest request, GridRegistry registry) { try { String proxyClass = request.getConfiguration().proxy; if (proxyClass == null) { log.fine("No proxy class. Using default"); proxyClass...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", "extends", "RemoteProxy", ">", "T", "getNewInstance", "(", "RegistrationRequest", "request", ",", "GridRegistry", "registry", ")", "{", "try", "{", "String", "proxyClass", "=", "re...
Takes a registration request and return the RemoteProxy associated to it. It can be any class extending RemoteProxy. @param request The request @param registry The registry to use @param <T> RemoteProxy subclass @return a new instance built from the request.
[ "Takes", "a", "registration", "request", "and", "return", "the", "RemoteProxy", "associated", "to", "it", ".", "It", "can", "be", "any", "class", "extending", "RemoteProxy", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/BaseRemoteProxy.java#L361-L386
124,764
SeleniumHQ/selenium
java/server/src/org/openqa/grid/internal/ProxySet.java
ProxySet.remove
public RemoteProxy remove(RemoteProxy proxy) { // Find the original proxy. While the supplied one is logically equivalent, it may be a fresh object with // an empty TestSlot list, which doesn't figure into the proxy equivalence check. Since we want to free up // those test sessions, we need to operate on t...
java
public RemoteProxy remove(RemoteProxy proxy) { // Find the original proxy. While the supplied one is logically equivalent, it may be a fresh object with // an empty TestSlot list, which doesn't figure into the proxy equivalence check. Since we want to free up // those test sessions, we need to operate on t...
[ "public", "RemoteProxy", "remove", "(", "RemoteProxy", "proxy", ")", "{", "// Find the original proxy. While the supplied one is logically equivalent, it may be a fresh object with", "// an empty TestSlot list, which doesn't figure into the proxy equivalence check. Since we want to free up", "/...
Removes the specified instance from the proxySet @param proxy The proxy to remove, must be present in this set @return The instance that was removed. Not null.
[ "Removes", "the", "specified", "instance", "from", "the", "proxySet" ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/ProxySet.java#L71-L82
124,765
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/remote/RemoteWebDriverBuilder.java
RemoteWebDriverBuilder.oneOf
public RemoteWebDriverBuilder oneOf(Capabilities maybeThis, Capabilities... orOneOfThese) { options.clear(); addAlternative(maybeThis); for (Capabilities anOrOneOfThese : orOneOfThese) { addAlternative(anOrOneOfThese); } return this; }
java
public RemoteWebDriverBuilder oneOf(Capabilities maybeThis, Capabilities... orOneOfThese) { options.clear(); addAlternative(maybeThis); for (Capabilities anOrOneOfThese : orOneOfThese) { addAlternative(anOrOneOfThese); } return this; }
[ "public", "RemoteWebDriverBuilder", "oneOf", "(", "Capabilities", "maybeThis", ",", "Capabilities", "...", "orOneOfThese", ")", "{", "options", ".", "clear", "(", ")", ";", "addAlternative", "(", "maybeThis", ")", ";", "for", "(", "Capabilities", "anOrOneOfThese",...
Clears the current set of alternative browsers and instead sets the list of possible choices to the arguments given to this method.
[ "Clears", "the", "current", "set", "of", "alternative", "browsers", "and", "instead", "sets", "the", "list", "of", "possible", "choices", "to", "the", "arguments", "given", "to", "this", "method", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/RemoteWebDriverBuilder.java#L106-L113
124,766
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/remote/RemoteWebDriverBuilder.java
RemoteWebDriverBuilder.addAlternative
public RemoteWebDriverBuilder addAlternative(Capabilities options) { Map<String, Object> serialized = validate(Objects.requireNonNull(options)); this.options.add(serialized); return this; }
java
public RemoteWebDriverBuilder addAlternative(Capabilities options) { Map<String, Object> serialized = validate(Objects.requireNonNull(options)); this.options.add(serialized); return this; }
[ "public", "RemoteWebDriverBuilder", "addAlternative", "(", "Capabilities", "options", ")", "{", "Map", "<", "String", ",", "Object", ">", "serialized", "=", "validate", "(", "Objects", ".", "requireNonNull", "(", "options", ")", ")", ";", "this", ".", "options...
Add to the list of possible configurations that might be asked for. It is possible to ask for more than one type of browser per session. For example, perhaps you have an extension that is available for two different kinds of browser, and you'd like to test it).
[ "Add", "to", "the", "list", "of", "possible", "configurations", "that", "might", "be", "asked", "for", ".", "It", "is", "possible", "to", "ask", "for", "more", "than", "one", "type", "of", "browser", "per", "session", ".", "For", "example", "perhaps", "y...
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/RemoteWebDriverBuilder.java#L120-L124
124,767
SeleniumHQ/selenium
java/server/src/org/openqa/selenium/server/htmlrunner/HTMLLauncher.java
HTMLLauncher.runHTMLSuite
public String runHTMLSuite( String browser, String startURL, String suiteURL, File outputFile, long timeoutInSeconds, String userExtensions) throws IOException { File parent = outputFile.getParentFile(); if (parent != null && !parent.exists()) { parent.mkdirs(); } if (outpu...
java
public String runHTMLSuite( String browser, String startURL, String suiteURL, File outputFile, long timeoutInSeconds, String userExtensions) throws IOException { File parent = outputFile.getParentFile(); if (parent != null && !parent.exists()) { parent.mkdirs(); } if (outpu...
[ "public", "String", "runHTMLSuite", "(", "String", "browser", ",", "String", "startURL", ",", "String", "suiteURL", ",", "File", "outputFile", ",", "long", "timeoutInSeconds", ",", "String", "userExtensions", ")", "throws", "IOException", "{", "File", "parent", ...
Launches a single HTML Selenium test suite. @param browser - the browserString ("*firefox", "*iexplore" or an executable path) @param startURL - the start URL for the browser @param suiteURL - the relative URL to the HTML suite @param outputFile - The file to which we'll output the HTML results @param timeoutInSeconds...
[ "Launches", "a", "single", "HTML", "Selenium", "test", "suite", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/selenium/server/htmlrunner/HTMLLauncher.java#L85-L142
124,768
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/safari/SafariDriver.java
SafariDriver.newWindow
@Beta public String newWindow(WindowType type) { Response response = execute( "SAFARI_NEW_WINDOW", ImmutableMap.of("newTab", type == WindowType.TAB)); return (String) response.getValue(); }
java
@Beta public String newWindow(WindowType type) { Response response = execute( "SAFARI_NEW_WINDOW", ImmutableMap.of("newTab", type == WindowType.TAB)); return (String) response.getValue(); }
[ "@", "Beta", "public", "String", "newWindow", "(", "WindowType", "type", ")", "{", "Response", "response", "=", "execute", "(", "\"SAFARI_NEW_WINDOW\"", ",", "ImmutableMap", ".", "of", "(", "\"newTab\"", ",", "type", "==", "WindowType", ".", "TAB", ")", ")",...
Open either a new tab or window, depending on what is requested, and return the window handle without switching to it. @return The handle of the new window.
[ "Open", "either", "a", "new", "tab", "or", "window", "depending", "on", "what", "is", "requested", "and", "return", "the", "window", "handle", "without", "switching", "to", "it", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/safari/SafariDriver.java#L97-L104
124,769
SeleniumHQ/selenium
java/server/src/org/openqa/grid/web/servlet/console/MiniCapability.java
MiniCapability.getConsoleIconPath
private String getConsoleIconPath(DesiredCapabilities cap) { String name = consoleIconName(cap); String path = "org/openqa/grid/images/"; InputStream in = Thread.currentThread().getContextClassLoader() .getResourceAsStream(path + name + ".png"); if (in == null) { return null; ...
java
private String getConsoleIconPath(DesiredCapabilities cap) { String name = consoleIconName(cap); String path = "org/openqa/grid/images/"; InputStream in = Thread.currentThread().getContextClassLoader() .getResourceAsStream(path + name + ".png"); if (in == null) { return null; ...
[ "private", "String", "getConsoleIconPath", "(", "DesiredCapabilities", "cap", ")", "{", "String", "name", "=", "consoleIconName", "(", "cap", ")", ";", "String", "path", "=", "\"org/openqa/grid/images/\"", ";", "InputStream", "in", "=", "Thread", ".", "currentThre...
get the icon representing the browser for the grid. If the icon cannot be located, returns null. @param cap - Capability @return String with path to icon image file. Can be <i>null</i> if no icon file if available.
[ "get", "the", "icon", "representing", "the", "browser", "for", "the", "grid", ".", "If", "the", "icon", "cannot", "be", "located", "returns", "null", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/web/servlet/console/MiniCapability.java#L60-L70
124,770
SeleniumHQ/selenium
java/server/src/org/openqa/grid/web/servlet/console/ConsoleServlet.java
ConsoleServlet.getConfigInfo
private String getConfigInfo() { StringBuilder builder = new StringBuilder(); builder.append("<div id='hub-config-container'>"); GridHubConfiguration config = getRegistry().getHub().getConfiguration(); builder.append("<div id='hub-config-content'>"); builder.append("<b>Config for the hub :</b><br/>...
java
private String getConfigInfo() { StringBuilder builder = new StringBuilder(); builder.append("<div id='hub-config-container'>"); GridHubConfiguration config = getRegistry().getHub().getConfiguration(); builder.append("<div id='hub-config-content'>"); builder.append("<b>Config for the hub :</b><br/>...
[ "private", "String", "getConfigInfo", "(", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "builder", ".", "append", "(", "\"<div id='hub-config-container'>\"", ")", ";", "GridHubConfiguration", "config", "=", "getRegistry", "(", ...
retracing how the hub config was built to help debugging. @return html representation of the hub config
[ "retracing", "how", "the", "hub", "config", "was", "built", "to", "help", "debugging", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/web/servlet/console/ConsoleServlet.java#L204-L219
124,771
SeleniumHQ/selenium
java/server/src/org/openqa/grid/web/servlet/console/ConsoleServlet.java
ConsoleServlet.getVerboseConfig
private String getVerboseConfig() { StringBuilder builder = new StringBuilder(); GridHubConfiguration config = getRegistry().getHub().getConfiguration(); builder.append("<div id='verbose-config-container'>"); builder.append("<a id='verbose-config-view-toggle' href='#'>View Verbose</a>"); builder.a...
java
private String getVerboseConfig() { StringBuilder builder = new StringBuilder(); GridHubConfiguration config = getRegistry().getHub().getConfiguration(); builder.append("<div id='verbose-config-container'>"); builder.append("<a id='verbose-config-view-toggle' href='#'>View Verbose</a>"); builder.a...
[ "private", "String", "getVerboseConfig", "(", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "GridHubConfiguration", "config", "=", "getRegistry", "(", ")", ".", "getHub", "(", ")", ".", "getConfiguration", "(", ")", ";", "...
Displays more detailed configuration @return html representation of the verbose hub config
[ "Displays", "more", "detailed", "configuration" ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/web/servlet/console/ConsoleServlet.java#L225-L255
124,772
SeleniumHQ/selenium
java/server/src/org/openqa/grid/selenium/proxy/DefaultRemoteProxy.java
DefaultRemoteProxy.getNewSession
@Override public TestSession getNewSession(Map<String, Object> requestedCapability) { if (down) { return null; } return super.getNewSession(requestedCapability); }
java
@Override public TestSession getNewSession(Map<String, Object> requestedCapability) { if (down) { return null; } return super.getNewSession(requestedCapability); }
[ "@", "Override", "public", "TestSession", "getNewSession", "(", "Map", "<", "String", ",", "Object", ">", "requestedCapability", ")", "{", "if", "(", "down", ")", "{", "return", "null", ";", "}", "return", "super", ".", "getNewSession", "(", "requestedCapabi...
overwrites the session allocation to discard the proxy that are down.
[ "overwrites", "the", "session", "allocation", "to", "discard", "the", "proxy", "that", "are", "down", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/selenium/proxy/DefaultRemoteProxy.java#L211-L217
124,773
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/remote/codec/AbstractHttpResponseCodec.java
AbstractHttpResponseCodec.encode
@Override public HttpResponse encode(Supplier<HttpResponse> factory, Response response) { int status = response.getStatus() == ErrorCodes.SUCCESS ? HTTP_OK : HTTP_INTERNAL_ERROR; byte[] data = json.toJson(getValueToEncode(response)).getBytes(UTF_8); HttpResponse httpRes...
java
@Override public HttpResponse encode(Supplier<HttpResponse> factory, Response response) { int status = response.getStatus() == ErrorCodes.SUCCESS ? HTTP_OK : HTTP_INTERNAL_ERROR; byte[] data = json.toJson(getValueToEncode(response)).getBytes(UTF_8); HttpResponse httpRes...
[ "@", "Override", "public", "HttpResponse", "encode", "(", "Supplier", "<", "HttpResponse", ">", "factory", ",", "Response", "response", ")", "{", "int", "status", "=", "response", ".", "getStatus", "(", ")", "==", "ErrorCodes", ".", "SUCCESS", "?", "HTTP_OK"...
Encodes the given response as a HTTP response message. This method is guaranteed not to throw. @param response The response to encode. @return The encoded response.
[ "Encodes", "the", "given", "response", "as", "a", "HTTP", "response", "message", ".", "This", "method", "is", "guaranteed", "not", "to", "throw", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/codec/AbstractHttpResponseCodec.java#L55-L72
124,774
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/json/JsonInput.java
JsonInput.propertySetting
public PropertySetting propertySetting(PropertySetting setter) { PropertySetting previous = this.setter; this.setter = Objects.requireNonNull(setter); return previous; }
java
public PropertySetting propertySetting(PropertySetting setter) { PropertySetting previous = this.setter; this.setter = Objects.requireNonNull(setter); return previous; }
[ "public", "PropertySetting", "propertySetting", "(", "PropertySetting", "setter", ")", "{", "PropertySetting", "previous", "=", "this", ".", "setter", ";", "this", ".", "setter", "=", "Objects", ".", "requireNonNull", "(", "setter", ")", ";", "return", "previous...
Change how property setting is done. It's polite to set the value back once done processing. @param setter The new {@link PropertySetting} to use. @return The previous {@link PropertySetting} that has just been replaced.
[ "Change", "how", "property", "setting", "is", "done", ".", "It", "s", "polite", "to", "set", "the", "value", "back", "once", "done", "processing", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/json/JsonInput.java#L54-L58
124,775
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/interactions/Actions.java
Actions.keyUp
public Actions keyUp(CharSequence key) { if (isBuildingActions()) { action.addAction(new KeyUpAction(jsonKeyboard, jsonMouse, asKeys(key))); } return addKeyAction(key, codePoint -> tick(defaultKeyboard.createKeyUp(codePoint))); }
java
public Actions keyUp(CharSequence key) { if (isBuildingActions()) { action.addAction(new KeyUpAction(jsonKeyboard, jsonMouse, asKeys(key))); } return addKeyAction(key, codePoint -> tick(defaultKeyboard.createKeyUp(codePoint))); }
[ "public", "Actions", "keyUp", "(", "CharSequence", "key", ")", "{", "if", "(", "isBuildingActions", "(", ")", ")", "{", "action", ".", "addAction", "(", "new", "KeyUpAction", "(", "jsonKeyboard", ",", "jsonMouse", ",", "asKeys", "(", "key", ")", ")", ")"...
Performs a modifier key release. Releasing a non-depressed modifier key will yield undefined behaviour. @param key Either {@link Keys#SHIFT}, {@link Keys#ALT} or {@link Keys#CONTROL}. @return A self reference.
[ "Performs", "a", "modifier", "key", "release", ".", "Releasing", "a", "non", "-", "depressed", "modifier", "key", "will", "yield", "undefined", "behaviour", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L119-L125
124,776
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/interactions/Actions.java
Actions.release
public Actions release() { if (isBuildingActions()) { action.addAction(new ButtonReleaseAction(jsonMouse, null)); } return tick(defaultMouse.createPointerUp(Button.LEFT.asArg())); }
java
public Actions release() { if (isBuildingActions()) { action.addAction(new ButtonReleaseAction(jsonMouse, null)); } return tick(defaultMouse.createPointerUp(Button.LEFT.asArg())); }
[ "public", "Actions", "release", "(", ")", "{", "if", "(", "isBuildingActions", "(", ")", ")", "{", "action", ".", "addAction", "(", "new", "ButtonReleaseAction", "(", "jsonMouse", ",", "null", ")", ")", ";", "}", "return", "tick", "(", "defaultMouse", "....
Releases the depressed left mouse button at the current mouse location. @see #release(org.openqa.selenium.WebElement) @return A self reference.
[ "Releases", "the", "depressed", "left", "mouse", "button", "at", "the", "current", "mouse", "location", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L276-L282
124,777
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/interactions/Actions.java
Actions.doubleClick
public Actions doubleClick() { if (isBuildingActions()) { action.addAction(new DoubleClickAction(jsonMouse, null)); } return clickInTicks(LEFT).clickInTicks(LEFT); }
java
public Actions doubleClick() { if (isBuildingActions()) { action.addAction(new DoubleClickAction(jsonMouse, null)); } return clickInTicks(LEFT).clickInTicks(LEFT); }
[ "public", "Actions", "doubleClick", "(", ")", "{", "if", "(", "isBuildingActions", "(", ")", ")", "{", "action", ".", "addAction", "(", "new", "DoubleClickAction", "(", "jsonMouse", ",", "null", ")", ")", ";", "}", "return", "clickInTicks", "(", "LEFT", ...
Performs a double-click at the current mouse location. @return A self reference.
[ "Performs", "a", "double", "-", "click", "at", "the", "current", "mouse", "location", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L344-L350
124,778
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/interactions/Actions.java
Actions.moveToElement
public Actions moveToElement(WebElement target) { if (isBuildingActions()) { action.addAction(new MoveMouseAction(jsonMouse, (Locatable) target)); } return moveInTicks(target, 0, 0); }
java
public Actions moveToElement(WebElement target) { if (isBuildingActions()) { action.addAction(new MoveMouseAction(jsonMouse, (Locatable) target)); } return moveInTicks(target, 0, 0); }
[ "public", "Actions", "moveToElement", "(", "WebElement", "target", ")", "{", "if", "(", "isBuildingActions", "(", ")", ")", "{", "action", ".", "addAction", "(", "new", "MoveMouseAction", "(", "jsonMouse", ",", "(", "Locatable", ")", "target", ")", ")", ";...
Moves the mouse to the middle of the element. The element is scrolled into view and its location is calculated using getBoundingClientRect. @param target element to move to. @return A self reference.
[ "Moves", "the", "mouse", "to", "the", "middle", "of", "the", "element", ".", "The", "element", "is", "scrolled", "into", "view", "and", "its", "location", "is", "calculated", "using", "getBoundingClientRect", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L358-L364
124,779
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/interactions/Actions.java
Actions.moveToElement
public Actions moveToElement(WebElement target, int xOffset, int yOffset) { if (isBuildingActions()) { action.addAction(new MoveToOffsetAction(jsonMouse, (Locatable) target, xOffset, yOffset)); } // Of course, this is the offset from the centre of the element. We have no idea what the width // an...
java
public Actions moveToElement(WebElement target, int xOffset, int yOffset) { if (isBuildingActions()) { action.addAction(new MoveToOffsetAction(jsonMouse, (Locatable) target, xOffset, yOffset)); } // Of course, this is the offset from the centre of the element. We have no idea what the width // an...
[ "public", "Actions", "moveToElement", "(", "WebElement", "target", ",", "int", "xOffset", ",", "int", "yOffset", ")", "{", "if", "(", "isBuildingActions", "(", ")", ")", "{", "action", ".", "addAction", "(", "new", "MoveToOffsetAction", "(", "jsonMouse", ","...
Moves the mouse to an offset from the top-left corner of the element. The element is scrolled into view and its location is calculated using getBoundingClientRect. @param target element to move to. @param xOffset Offset from the top-left corner. A negative value means coordinates left from the element. @param yOffset O...
[ "Moves", "the", "mouse", "to", "an", "offset", "from", "the", "top", "-", "left", "corner", "of", "the", "element", ".", "The", "element", "is", "scrolled", "into", "view", "and", "its", "location", "is", "calculated", "using", "getBoundingClientRect", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L376-L385
124,780
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/interactions/Actions.java
Actions.contextClick
public Actions contextClick(WebElement target) { if (isBuildingActions()) { action.addAction(new ContextClickAction(jsonMouse, (Locatable) target)); } return moveInTicks(target, 0, 0).clickInTicks(RIGHT); }
java
public Actions contextClick(WebElement target) { if (isBuildingActions()) { action.addAction(new ContextClickAction(jsonMouse, (Locatable) target)); } return moveInTicks(target, 0, 0).clickInTicks(RIGHT); }
[ "public", "Actions", "contextClick", "(", "WebElement", "target", ")", "{", "if", "(", "isBuildingActions", "(", ")", ")", "{", "action", ".", "addAction", "(", "new", "ContextClickAction", "(", "jsonMouse", ",", "(", "Locatable", ")", "target", ")", ")", ...
Performs a context-click at middle of the given element. First performs a mouseMove to the location of the element. @param target Element to move to. @return A self reference.
[ "Performs", "a", "context", "-", "click", "at", "middle", "of", "the", "given", "element", ".", "First", "performs", "a", "mouseMove", "to", "the", "location", "of", "the", "element", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L421-L426
124,781
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/interactions/Actions.java
Actions.contextClick
public Actions contextClick() { if (isBuildingActions()) { action.addAction(new ContextClickAction(jsonMouse, null)); } return clickInTicks(RIGHT); }
java
public Actions contextClick() { if (isBuildingActions()) { action.addAction(new ContextClickAction(jsonMouse, null)); } return clickInTicks(RIGHT); }
[ "public", "Actions", "contextClick", "(", ")", "{", "if", "(", "isBuildingActions", "(", ")", ")", "{", "action", ".", "addAction", "(", "new", "ContextClickAction", "(", "jsonMouse", ",", "null", ")", ")", ";", "}", "return", "clickInTicks", "(", "RIGHT",...
Performs a context-click at the current mouse location. @return A self reference.
[ "Performs", "a", "context", "-", "click", "at", "the", "current", "mouse", "location", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L432-L438
124,782
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/interactions/Actions.java
Actions.dragAndDrop
public Actions dragAndDrop(WebElement source, WebElement target) { if (isBuildingActions()) { action.addAction(new ClickAndHoldAction(jsonMouse, (Locatable) source)); action.addAction(new MoveMouseAction(jsonMouse, (Locatable) target)); action.addAction(new ButtonReleaseAction(jsonMouse, (Locatabl...
java
public Actions dragAndDrop(WebElement source, WebElement target) { if (isBuildingActions()) { action.addAction(new ClickAndHoldAction(jsonMouse, (Locatable) source)); action.addAction(new MoveMouseAction(jsonMouse, (Locatable) target)); action.addAction(new ButtonReleaseAction(jsonMouse, (Locatabl...
[ "public", "Actions", "dragAndDrop", "(", "WebElement", "source", ",", "WebElement", "target", ")", "{", "if", "(", "isBuildingActions", "(", ")", ")", "{", "action", ".", "addAction", "(", "new", "ClickAndHoldAction", "(", "jsonMouse", ",", "(", "Locatable", ...
A convenience method that performs click-and-hold at the location of the source element, moves to the location of the target element, then releases the mouse. @param source element to emulate button down at. @param target element to move to and release the mouse at. @return A self reference.
[ "A", "convenience", "method", "that", "performs", "click", "-", "and", "-", "hold", "at", "the", "location", "of", "the", "source", "element", "moves", "to", "the", "location", "of", "the", "target", "element", "then", "releases", "the", "mouse", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L448-L459
124,783
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/interactions/Actions.java
Actions.dragAndDropBy
public Actions dragAndDropBy(WebElement source, int xOffset, int yOffset) { if (isBuildingActions()) { action.addAction(new ClickAndHoldAction(jsonMouse, (Locatable) source)); action.addAction(new MoveToOffsetAction(jsonMouse, null, xOffset, yOffset)); action.addAction(new ButtonReleaseAction(json...
java
public Actions dragAndDropBy(WebElement source, int xOffset, int yOffset) { if (isBuildingActions()) { action.addAction(new ClickAndHoldAction(jsonMouse, (Locatable) source)); action.addAction(new MoveToOffsetAction(jsonMouse, null, xOffset, yOffset)); action.addAction(new ButtonReleaseAction(json...
[ "public", "Actions", "dragAndDropBy", "(", "WebElement", "source", ",", "int", "xOffset", ",", "int", "yOffset", ")", "{", "if", "(", "isBuildingActions", "(", ")", ")", "{", "action", ".", "addAction", "(", "new", "ClickAndHoldAction", "(", "jsonMouse", ","...
A convenience method that performs click-and-hold at the location of the source element, moves by a given offset, then releases the mouse. @param source element to emulate button down at. @param xOffset horizontal move offset. @param yOffset vertical move offset. @return A self reference.
[ "A", "convenience", "method", "that", "performs", "click", "-", "and", "-", "hold", "at", "the", "location", "of", "the", "source", "element", "moves", "by", "a", "given", "offset", "then", "releases", "the", "mouse", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L470-L481
124,784
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/interactions/Actions.java
Actions.pause
public Actions pause(long pause) { if (isBuildingActions()) { action.addAction(new PauseAction(pause)); } return tick(new Pause(defaultMouse, Duration.ofMillis(pause))); }
java
public Actions pause(long pause) { if (isBuildingActions()) { action.addAction(new PauseAction(pause)); } return tick(new Pause(defaultMouse, Duration.ofMillis(pause))); }
[ "public", "Actions", "pause", "(", "long", "pause", ")", "{", "if", "(", "isBuildingActions", "(", ")", ")", "{", "action", ".", "addAction", "(", "new", "PauseAction", "(", "pause", ")", ")", ";", "}", "return", "tick", "(", "new", "Pause", "(", "de...
Performs a pause. @param pause pause duration, in milliseconds. @return A self reference.
[ "Performs", "a", "pause", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L489-L495
124,785
SeleniumHQ/selenium
java/client/src/com/thoughtworks/selenium/Wait.java
Wait.wait
public void wait(String message, long timeoutInMilliseconds, long intervalInMilliseconds) { long start = System.currentTimeMillis(); long end = start + timeoutInMilliseconds; while (System.currentTimeMillis() < end) { if (until()) return; try { Thread.sleep(intervalInMilliseconds); ...
java
public void wait(String message, long timeoutInMilliseconds, long intervalInMilliseconds) { long start = System.currentTimeMillis(); long end = start + timeoutInMilliseconds; while (System.currentTimeMillis() < end) { if (until()) return; try { Thread.sleep(intervalInMilliseconds); ...
[ "public", "void", "wait", "(", "String", "message", ",", "long", "timeoutInMilliseconds", ",", "long", "intervalInMilliseconds", ")", "{", "long", "start", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "long", "end", "=", "start", "+", "timeoutInMill...
Wait until the "until" condition returns true or time runs out. @param message the failure message @param timeoutInMilliseconds the amount of time to wait before giving up @param intervalInMilliseconds the interval to pause between checking "until" @throws WaitTimedOutException if "until" doesn't return true until the...
[ "Wait", "until", "the", "until", "condition", "returns", "true", "or", "time", "runs", "out", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/com/thoughtworks/selenium/Wait.java#L87-L99
124,786
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/remote/http/HttpRequest.java
HttpRequest.getQueryParameter
public String getQueryParameter(String name) { Iterable<String> allParams = getQueryParameters(name); if (allParams == null) { return null; } Iterator<String> iterator = allParams.iterator(); return iterator.hasNext() ? iterator.next() : null; }
java
public String getQueryParameter(String name) { Iterable<String> allParams = getQueryParameters(name); if (allParams == null) { return null; } Iterator<String> iterator = allParams.iterator(); return iterator.hasNext() ? iterator.next() : null; }
[ "public", "String", "getQueryParameter", "(", "String", "name", ")", "{", "Iterable", "<", "String", ">", "allParams", "=", "getQueryParameters", "(", "name", ")", ";", "if", "(", "allParams", "==", "null", ")", "{", "return", "null", ";", "}", "Iterator",...
Get a query parameter. The implementation will take care of decoding from the percent encoding.
[ "Get", "a", "query", "parameter", ".", "The", "implementation", "will", "take", "care", "of", "decoding", "from", "the", "percent", "encoding", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/http/HttpRequest.java#L48-L55
124,787
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/remote/http/HttpRequest.java
HttpRequest.addQueryParameter
public HttpRequest addQueryParameter(String name, String value) { queryParameters.put( Objects.requireNonNull(name, "Name must be set"), Objects.requireNonNull(value, "Value must be set")); return this; }
java
public HttpRequest addQueryParameter(String name, String value) { queryParameters.put( Objects.requireNonNull(name, "Name must be set"), Objects.requireNonNull(value, "Value must be set")); return this; }
[ "public", "HttpRequest", "addQueryParameter", "(", "String", "name", ",", "String", "value", ")", "{", "queryParameters", ".", "put", "(", "Objects", ".", "requireNonNull", "(", "name", ",", "\"Name must be set\"", ")", ",", "Objects", ".", "requireNonNull", "("...
Set a query parameter, adding to existing values if present. The implementation will ensure that the name and value are properly encoded.
[ "Set", "a", "query", "parameter", "adding", "to", "existing", "values", "if", "present", ".", "The", "implementation", "will", "ensure", "that", "the", "name", "and", "value", "are", "properly", "encoded", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/http/HttpRequest.java#L61-L66
124,788
SeleniumHQ/selenium
java/server/src/org/openqa/selenium/remote/server/xdrpc/CrossDomainRpcLoader.java
CrossDomainRpcLoader.loadRpc
public CrossDomainRpc loadRpc(HttpServletRequest request) throws IOException { Charset encoding; try { String enc = request.getCharacterEncoding(); encoding = Charset.forName(enc); } catch (IllegalArgumentException | NullPointerException e) { encoding = UTF_8; } // We tend to look...
java
public CrossDomainRpc loadRpc(HttpServletRequest request) throws IOException { Charset encoding; try { String enc = request.getCharacterEncoding(); encoding = Charset.forName(enc); } catch (IllegalArgumentException | NullPointerException e) { encoding = UTF_8; } // We tend to look...
[ "public", "CrossDomainRpc", "loadRpc", "(", "HttpServletRequest", "request", ")", "throws", "IOException", "{", "Charset", "encoding", ";", "try", "{", "String", "enc", "=", "request", ".", "getCharacterEncoding", "(", ")", ";", "encoding", "=", "Charset", ".", ...
Parses the request for a CrossDomainRpc. @param request The request to parse. @return The parsed RPC. @throws IOException If an error occurs reading from the request. @throws IllegalArgumentException If an occurs while parsing the request data.
[ "Parses", "the", "request", "for", "a", "CrossDomainRpc", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/selenium/remote/server/xdrpc/CrossDomainRpcLoader.java#L52-L75
124,789
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/firefox/FirefoxDriver.java
FirefoxDriver.dropCapabilities
private static Capabilities dropCapabilities(Capabilities capabilities) { if (capabilities == null) { return new ImmutableCapabilities(); } MutableCapabilities caps; if (isLegacy(capabilities)) { final Set<String> toRemove = Sets.newHashSet(BINARY, PROFILE); caps = new MutableCapabil...
java
private static Capabilities dropCapabilities(Capabilities capabilities) { if (capabilities == null) { return new ImmutableCapabilities(); } MutableCapabilities caps; if (isLegacy(capabilities)) { final Set<String> toRemove = Sets.newHashSet(BINARY, PROFILE); caps = new MutableCapabil...
[ "private", "static", "Capabilities", "dropCapabilities", "(", "Capabilities", "capabilities", ")", "{", "if", "(", "capabilities", "==", "null", ")", "{", "return", "new", "ImmutableCapabilities", "(", ")", ";", "}", "MutableCapabilities", "caps", ";", "if", "("...
Drops capabilities that we shouldn't send over the wire. Used for capabilities which aren't BeanToJson-convertable, and are only used by the local launcher.
[ "Drops", "capabilities", "that", "we", "shouldn", "t", "send", "over", "the", "wire", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/firefox/FirefoxDriver.java#L231-L253
124,790
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/io/TemporaryFilesystem.java
TemporaryFilesystem.createTempDir
public File createTempDir(String prefix, String suffix) { try { // Create a tempfile, and delete it. File file = File.createTempFile(prefix, suffix, baseDir); file.delete(); // Create it as a directory. File dir = new File(file.getAbsolutePath()); if (!dir.mkdirs()) { th...
java
public File createTempDir(String prefix, String suffix) { try { // Create a tempfile, and delete it. File file = File.createTempFile(prefix, suffix, baseDir); file.delete(); // Create it as a directory. File dir = new File(file.getAbsolutePath()); if (!dir.mkdirs()) { th...
[ "public", "File", "createTempDir", "(", "String", "prefix", ",", "String", "suffix", ")", "{", "try", "{", "// Create a tempfile, and delete it.", "File", "file", "=", "File", ".", "createTempFile", "(", "prefix", ",", "suffix", ",", "baseDir", ")", ";", "file...
Create a temporary directory, and track it for deletion. @param prefix the prefix to use when creating the temporary directory @param suffix the suffix to use when creating the temporary directory @return the temporary directory to create
[ "Create", "a", "temporary", "directory", "and", "track", "it", "for", "deletion", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/io/TemporaryFilesystem.java#L90-L111
124,791
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/io/TemporaryFilesystem.java
TemporaryFilesystem.deleteTempDir
public void deleteTempDir(File file) { if (!shouldReap()) { return; } // If the tempfile can be removed, delete it. If not, it wasn't created by us. if (temporaryFiles.remove(file)) { FileHandler.delete(file); } }
java
public void deleteTempDir(File file) { if (!shouldReap()) { return; } // If the tempfile can be removed, delete it. If not, it wasn't created by us. if (temporaryFiles.remove(file)) { FileHandler.delete(file); } }
[ "public", "void", "deleteTempDir", "(", "File", "file", ")", "{", "if", "(", "!", "shouldReap", "(", ")", ")", "{", "return", ";", "}", "// If the tempfile can be removed, delete it. If not, it wasn't created by us.", "if", "(", "temporaryFiles", ".", "remove", "(",...
Delete a temporary directory that we were responsible for creating. @param file the file to delete @throws WebDriverException if interrupted
[ "Delete", "a", "temporary", "directory", "that", "we", "were", "responsible", "for", "creating", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/io/TemporaryFilesystem.java#L119-L128
124,792
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/io/TemporaryFilesystem.java
TemporaryFilesystem.deleteTemporaryFiles
public void deleteTemporaryFiles() { if (!shouldReap()) { return; } for (File file : temporaryFiles) { try { FileHandler.delete(file); } catch (WebDriverException e) { // ignore; an interrupt will already have been logged. } } }
java
public void deleteTemporaryFiles() { if (!shouldReap()) { return; } for (File file : temporaryFiles) { try { FileHandler.delete(file); } catch (WebDriverException e) { // ignore; an interrupt will already have been logged. } } }
[ "public", "void", "deleteTemporaryFiles", "(", ")", "{", "if", "(", "!", "shouldReap", "(", ")", ")", "{", "return", ";", "}", "for", "(", "File", "file", ":", "temporaryFiles", ")", "{", "try", "{", "FileHandler", ".", "delete", "(", "file", ")", ";...
Perform the operation that a shutdown hook would have.
[ "Perform", "the", "operation", "that", "a", "shutdown", "hook", "would", "have", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/io/TemporaryFilesystem.java#L133-L145
124,793
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/Proxy.java
Proxy.setAutodetect
public Proxy setAutodetect(boolean autodetect) { if (this.autodetect == autodetect) { return this; } if (autodetect) { verifyProxyTypeCompatibility(ProxyType.AUTODETECT); this.proxyType = ProxyType.AUTODETECT; } else { this.proxyType = ProxyType.UNSPECIFIED; } this.autode...
java
public Proxy setAutodetect(boolean autodetect) { if (this.autodetect == autodetect) { return this; } if (autodetect) { verifyProxyTypeCompatibility(ProxyType.AUTODETECT); this.proxyType = ProxyType.AUTODETECT; } else { this.proxyType = ProxyType.UNSPECIFIED; } this.autode...
[ "public", "Proxy", "setAutodetect", "(", "boolean", "autodetect", ")", "{", "if", "(", "this", ".", "autodetect", "==", "autodetect", ")", "{", "return", "this", ";", "}", "if", "(", "autodetect", ")", "{", "verifyProxyTypeCompatibility", "(", "ProxyType", "...
Specifies whether to autodetect proxy settings. @param autodetect set to true to use proxy auto detection, false to leave proxy settings unspecified @return reference to self
[ "Specifies", "whether", "to", "autodetect", "proxy", "settings", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/Proxy.java#L188-L200
124,794
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/Proxy.java
Proxy.setSslProxy
public Proxy setSslProxy(String sslProxy) { verifyProxyTypeCompatibility(ProxyType.MANUAL); this.proxyType = ProxyType.MANUAL; this.sslProxy = sslProxy; return this; }
java
public Proxy setSslProxy(String sslProxy) { verifyProxyTypeCompatibility(ProxyType.MANUAL); this.proxyType = ProxyType.MANUAL; this.sslProxy = sslProxy; return this; }
[ "public", "Proxy", "setSslProxy", "(", "String", "sslProxy", ")", "{", "verifyProxyTypeCompatibility", "(", "ProxyType", ".", "MANUAL", ")", ";", "this", ".", "proxyType", "=", "ProxyType", ".", "MANUAL", ";", "this", ".", "sslProxy", "=", "sslProxy", ";", "...
Specify which proxy to use for SSL connections. @param sslProxy the proxy host, expected format is <code>hostname.com:1234</code> @return reference to self
[ "Specify", "which", "proxy", "to", "use", "for", "SSL", "connections", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/Proxy.java#L283-L288
124,795
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/Proxy.java
Proxy.setSocksProxy
public Proxy setSocksProxy(String socksProxy) { verifyProxyTypeCompatibility(ProxyType.MANUAL); this.proxyType = ProxyType.MANUAL; this.socksProxy = socksProxy; return this; }
java
public Proxy setSocksProxy(String socksProxy) { verifyProxyTypeCompatibility(ProxyType.MANUAL); this.proxyType = ProxyType.MANUAL; this.socksProxy = socksProxy; return this; }
[ "public", "Proxy", "setSocksProxy", "(", "String", "socksProxy", ")", "{", "verifyProxyTypeCompatibility", "(", "ProxyType", ".", "MANUAL", ")", ";", "this", ".", "proxyType", "=", "ProxyType", ".", "MANUAL", ";", "this", ".", "socksProxy", "=", "socksProxy", ...
Specifies which proxy to use for SOCKS. @param socksProxy the proxy host, expected format is <code>hostname.com:1234</code> @return reference to self
[ "Specifies", "which", "proxy", "to", "use", "for", "SOCKS", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/Proxy.java#L305-L310
124,796
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/Proxy.java
Proxy.setSocksUsername
public Proxy setSocksUsername(String username) { verifyProxyTypeCompatibility(ProxyType.MANUAL); this.proxyType = ProxyType.MANUAL; this.socksUsername = username; return this; }
java
public Proxy setSocksUsername(String username) { verifyProxyTypeCompatibility(ProxyType.MANUAL); this.proxyType = ProxyType.MANUAL; this.socksUsername = username; return this; }
[ "public", "Proxy", "setSocksUsername", "(", "String", "username", ")", "{", "verifyProxyTypeCompatibility", "(", "ProxyType", ".", "MANUAL", ")", ";", "this", ".", "proxyType", "=", "ProxyType", ".", "MANUAL", ";", "this", ".", "socksUsername", "=", "username", ...
Specifies a username for the SOCKS proxy. Supported by SOCKS v5 and above. @param username username for the SOCKS proxy @return reference to self
[ "Specifies", "a", "username", "for", "the", "SOCKS", "proxy", ".", "Supported", "by", "SOCKS", "v5", "and", "above", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/Proxy.java#L349-L354
124,797
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/Proxy.java
Proxy.setSocksPassword
public Proxy setSocksPassword(String password) { verifyProxyTypeCompatibility(ProxyType.MANUAL); this.proxyType = ProxyType.MANUAL; this.socksPassword = password; return this; }
java
public Proxy setSocksPassword(String password) { verifyProxyTypeCompatibility(ProxyType.MANUAL); this.proxyType = ProxyType.MANUAL; this.socksPassword = password; return this; }
[ "public", "Proxy", "setSocksPassword", "(", "String", "password", ")", "{", "verifyProxyTypeCompatibility", "(", "ProxyType", ".", "MANUAL", ")", ";", "this", ".", "proxyType", "=", "ProxyType", ".", "MANUAL", ";", "this", ".", "socksPassword", "=", "password", ...
Specifies a password for the SOCKS proxy. Supported by SOCKS v5 and above. @param password password for the SOCKS proxy @return reference to self
[ "Specifies", "a", "password", "for", "the", "SOCKS", "proxy", ".", "Supported", "by", "SOCKS", "v5", "and", "above", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/Proxy.java#L371-L376
124,798
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/logging/LogLevelMapping.java
LogLevelMapping.normalize
public static Level normalize(Level level) { if (levelMap.containsKey(level.intValue())) { return levelMap.get(level.intValue()); } else if (level.intValue() >= Level.SEVERE.intValue()) { return Level.SEVERE; } else if (level.intValue() >= Level.WARNING.intValue()) { return Level.WARNING; ...
java
public static Level normalize(Level level) { if (levelMap.containsKey(level.intValue())) { return levelMap.get(level.intValue()); } else if (level.intValue() >= Level.SEVERE.intValue()) { return Level.SEVERE; } else if (level.intValue() >= Level.WARNING.intValue()) { return Level.WARNING; ...
[ "public", "static", "Level", "normalize", "(", "Level", "level", ")", "{", "if", "(", "levelMap", ".", "containsKey", "(", "level", ".", "intValue", "(", ")", ")", ")", "{", "return", "levelMap", ".", "get", "(", "level", ".", "intValue", "(", ")", "...
Normalizes the given level to one of those supported by Selenium. @param level log level to normalize @return the selenium supported corresponding log level
[ "Normalizes", "the", "given", "level", "to", "one", "of", "those", "supported", "by", "Selenium", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/logging/LogLevelMapping.java#L56-L68
124,799
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/logging/LogLevelMapping.java
LogLevelMapping.getName
public static String getName(Level level) { Level normalized = normalize(level); return normalized == Level.FINE ? DEBUG : normalized.getName(); }
java
public static String getName(Level level) { Level normalized = normalize(level); return normalized == Level.FINE ? DEBUG : normalized.getName(); }
[ "public", "static", "String", "getName", "(", "Level", "level", ")", "{", "Level", "normalized", "=", "normalize", "(", "level", ")", ";", "return", "normalized", "==", "Level", ".", "FINE", "?", "DEBUG", ":", "normalized", ".", "getName", "(", ")", ";",...
Converts the JDK level to a name supported by Selenium. @param level log level to get the string name of @return string name representation of the level selenium supports
[ "Converts", "the", "JDK", "level", "to", "a", "name", "supported", "by", "Selenium", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/logging/LogLevelMapping.java#L76-L79