SECTION: 900-Content
TITLE: International
QUESTION: How do I work with international characters?
by<EMAIL_ADDRESS>Internet standards support for international character sets was historically weak, is now improving, but is still not perfect. The current standards situation is confusing, and has led to false expectations about what can be reliably achieved using today's browsers, protocols and servers.
Jetty fully supports and implements the current relevant standards and specifications, but this alone is not sufficient to make working with international characters easy or reliable in all situations. This FAQ explains the current standards, provides hints and tips for building and decoding Internationalised web pages (including ones with dynamic data) and explains how Jetty has anticipated the probable future direction of the standards.
The intended readership is people developing Servlet applications and their associated web pages. A basic knowledge of Java, HTML and of hexadecimal notation is assumed.
Unless otherwise stated, the information below applies to all current (August 2002) standards-conformant Web Servers, not just to Jetty.
There are four groups whose standards and specifications affect character handling in web pages:
The Internet was initially designed and constructed using basic English characters encoded in the 7-bit US-ASCII character set. This provides 26 upper and lower case letters, 10 digits, and a variety of punctuation and other symbols - it encodes 95 'printing' characters. Today, these are still the only printable characters which can be used in HTTP.
A single byte (8 bits) has the capacity to represent up to 256 characters. There are several widely-used encodings which give the US-ASCII characters their normal values in the range 0-127, and a selection of other characters are assigned code values in the range 128-255. In many web browsers the encoding to use can either be specified by the web page designer or selected by the user. Some of these encodings are proprietary, others specified by consortia or international standards bodies.
The first approaches to supporting international characters involved selecting one of these 8-bit character sets, and attempting to ensure that the web page source, the browser, and any server using data from that browser were using the same character encoding.
There is a default character set ISO-8859-1, which supports most western European
languages, and is currently the official 'default' content encoding for content
carried by HTTP (but not for data included in URLs - see below). This
is also the default for all Jetty versions except 4.0.x. Alternative
encodings may be specified by defining the HTTP Content-Type
header
of the page to be something like "text/html; charset=ISO-8859-4
".
From a Servlet you can use request.setContentType("text/html; charset=ISO-8859-4");
. Pages can then be composed using the desired literal characters (e.g.
accented letters from Europe or, with a different encoding selected, Japanese
characters). This mechanism can be unreliable; the browser's user can select
the encoding to be applied, which may be different from that intended by the
servlet designer.
Today the Internet is converging on a single, common encoding - Unicode - in which can be represented all known written languages, as well as a wide range of symbols (e.g. mathematical symbols and decorative marks). Unicode requires a 16-bit integer value to represent each character. By design, the 95 printable US-ASCII characters have the same code values in Unicode; US-ASCII is a subset of Unicode. Most modern browsers can decode and display a wide range of the characters represented by Unicode - but it would be rare to find a browser capable of displaying all the Unicode characters.
Unicode is the only character encoding used in XML and is now the default in HTML, XHML and in most Java implementations.
The Internet transmits data in groups of 8 bits, which the IETF usually call 'octets', but everyone else calls 'bytes'. When larger values have to be sent, such as the 16 bits needed for Unicode and some other international character encodings, there has to be a convention on how the 16 bits are packed into one or more octets. There are two standards commonly used to encode Unicode: UTF-8 and UTF-16.
UTF-16 is the 'brute-force' encoding for data transmission. The 16 bits representing the character value are placed in adjacent octets. Variants of UTF-16 place the octets in different orders.
UTF-8 is more common, and is recommended for most purposes. Characters with values less 0080 (hexadecimal notation) are transmitted as a single octet whose value is that of the character. Characters with values in the range 0080 to 07FF are encoded as two octets, whilst the (infrequently-used) Unicode characters with values between 0800 and FFFF are encoded into three octets. This encoding has the really useful property that a sequence of (7-bit) US-ASCII characters sent as bytes and then sent as Unicode UTF-8 octets produce identical octet streams - a US-ASCII byte stream is a valid UTF-8 octet stream and represents the same printing characters. This is not the case if other characters are being sent, or if UTF-16 is in use.
As well as having US-ASCII compatibility, UTF-8 is preferred because, in the majority of situations, it results in shorter messages than UTF-16.
Note that, when UTF-8 is specified, it not only defines the way in which the character code values are packed into octets, it also implicitly defines the character encoding in use as Unicode.
There is an international standard - ISO-10646 - which defines an identical character set to Unicode - but omits much essential additional information. For most purposes refer to Unicode rather than ISO-10646.
There are two places in which HTTP requests (from browsers to web servers) may include character data:
<form method='post'...> ... </form>
submissionWherever possible, a POST method should be used when international characters are involved.
This is because:
The HTTP Content-Type
header is used to tell the web server's
Servlet classes which encoding was used. By the time the characters are made
available to the Servlet as a String it is in the Unicode encoding used by Java.
A typical URL looks like:
http://www.my.site/dir/page.html
When a form is sent, using the default GET method, the data values from the form are included in the URL, e.g.:
http://www.my.site/dir/page.html?name=Durst&age=18
It is important to note that only a very restricted sub-set of the US-ASCII printing characters are permitted in URLs.
Something like name=Dürst
(with an umlaut) is illegal. It
might work with some browser/server combinations (and might even deliver the
expected value), but it should never be used.
The HTTP Specification provides an 'escape' mechanism, which permits arbitrary octet values to be included in the URL. The three characters %HH - where HH are hexadecimal characters - inserts the specified octet value into the URL. This has to be used for the US-ASCII characters which may not appear literally in URLs, and can be used for other octet values.
It is a common fallacy that this permits international characters to be reliably transmitted. This is wrong.
Current standards (July 2002) provide no basis for the reliable transmission of international characters using the URL %HH escape mechanism.
This is because the %HH escape permits the transmission of a sequence of octets, but has nothing to say about what character encoding is in use.
There is no provision in the HTTP protocol for the sender (the browser) to tell the receiver (the web server) what encoding has been used in the URI, and none of the specifications related to HTTP/HTML define a default encoding.
Thus, although any desired octet sequence can be placed in a URL, none of the standards tell the web server how to interpret that octet sequence.
The designers of web servers with Servlet APIs currently have a problem. They are presented with an octet stream of unspecified encoding, and yet have to deliver a Java String (a sequence of decoded characters) to the Servlet API.
There is an Internet draft (which expires Oct. 2002) which proposes that URLs should evolve into Internationalized Resource Identifiers (IRIs). This work-in-progress proposes that an octet sequence (generated by a combination of US-ASCII printing characters and %HH escapes) should always represent a UTF-8 character sequence.
The 4.0.x release of Jetty made this assumption of UTF-8, in anticipation of the draft (or something like it) becoming the formal specification. Earlier releases of Jetty (and other web servers) made different assumptions about the encoding of octets outside the 'core' US-ASCII range.
During July 2002 the likely RFC direction seems to have evolved again. It now appears that the character encoding in URIs will always remain 'undefined'. A totally new RFC for IRIs is likely to be proposed.
Accordingly, Jetty 4.1 has reverted to a default encoding of ISO-8859-1.
There are many ways in which international characters can be displayed or placed into browsers for inclusion in HTTP requests. Some examples are:
/servlet?name=D%C3%BCrst
'>...</form>/servlet?name=D%C3%BCrst
'>...</a>It is also possible to manipulate document text using the DOM APIs.
It is believed that, in all the above examples, all modern browsers (those supporting HTML 4) will treat the &...; encoding as representing Unicode characters. Earlier ones may not understand this encoding.
The first example, with the literal ü, should only be used if the character encoding can be relied upon, and if support for 'legacy' browsers (those not understanding the &...; encoding) is essential.
It is, of course, possible for users to enter characters using <input..> and <textarea...> elements via the operating system. Text can come from keyboards, and also from 'cut and paste' mechanisms. It appears that most browsers use their current (user-selectable) 'Encoding' setting (e.g. in MSIE: View..Encoding) to encode such characters. After the User has selected the encoding to use, it appears that many browsers will transmit the data characters in the request in that locally-defined encoding, rather than the one specified with the page.
The only reliable, standards-supported way to handle international characters in a browser- and server-neutral way appears to be:
<form method='post' ...>
method of submission.It is sometimes suggested that all forms can and should be submitted using the above POST method. There is, in fact, a valid need to use the default GET method.
To appreciate this need one must consider carefully a significant difference between submitting a form using POST and GET. When using GET the data values from the form are appended to the URI and form part of the visible 'address' seen at the top of the browser. It is also this entire string that is saved if the page is bookmarked by the browser, and may be moved using 'cut-and-paste' into an eMail, another web page etc..
It is possible that the dynamic data from the form is an integral part of the semantics of the 'page address' to be stored.
The address may be part of a map; one of the data values from the map may define the town on which the map view is to be centered - and this name may only be expressible in, say, Thai characters. The town name may have been entered or selected by the user - it was not a 'literal' in the HTML defining the page or in the URL.
Another common need is to 'bookmark' or sent by eMail the request string from a search engine request which has non-ASCII characters in the search.
There is not yet any standards-based way of constructing this dynamically-defined URL - there is no direct way to be certain what character encodings have been applied in constructing the URI-with-query string that the browser generates.
A work-around which has been suggested is to provide additional, known text
fields alongside the unknown text. In the example above, the form with the dynamically-defined
town name could also have a hidden field into which the generated page inserts
'known' text from the same character set (using the &...; encoding). When
the request is eventually received by a servlet the octet contents of the known
field are inspected (typically by using request.getQueryString()
). If the characters of the 'tracer' field are the same as those injected into
the page when it was generated (and the character code values encompass those
of the unknown town) then there is an assumption that the encoding used was
Unicode and that the town name as present in Java is accurate.
If the the actual encoding can be deduced from the 'tracer' octets, the Servlet
API request.setCharacterEncoding()
can be called (before calling
any of the .getParameter()
methods) to tell the web server which
encoding to assume when decoding the query.
There is an obvious potential flaw in this 'tracer' technique - the browser may represent &...;-specified 'tracer' text with its Unicode values, yet may use the local keyboard/operating system encoding for locally-entered data. The author is not aware of any conclusive knowledge or evidence in this area.
An alternative work-around, which is more complex but might be more certain if GET has to be used, would be to use Javascript or the DOM interfaces to transfer the characters from the input fields to the query part of the URL string.
Jetty configuration files use XML. If international characters need to be included
in these files, the standard XML character encoding method should be used. Where
the character has a defined abbreviation (such as ü
for
u-umlaut), that should be used. In other cases the hexadecimal description of
the character's Unicode code value should be used. For example Α
defines the Greek capital A letter. Use of the decimal form (Α)
seems now to be unfashionable in W3C circles.
It is to be hoped that something like the IRI scheme described in the Internet
Draft will evolve into a standard that will be adopted by suppliers of web servers
and browsers. It will probably also need changes to HTTP and/or the use of internationalised
versions of the http
and https
protocols. As currently
drafted, such a scheme would not, of its own solve the problem of dynamic data
derived from form GET submissions. This will require changes to HTML4 or, more
likely, extensions to a future version of XHTML.
The whole area of form data handling may be radically improved if the Xforms program is successful. This has defined an XML-based approach to forms and associated data and event handling and uses Unicode throughout. The Xforms 1.0 specification is currently (August 2002) at 'last call working draft' status, and a number of experimental implementations, some using browser applets or plug-ins, have been announced.
Neither of these likely developments will improve the handling of international characters by 'todays' browsers, so designers of web services for the 'open' market seem likely to have to work within today's constraints for a long time.
Anyone interested in the full complexity of handing international characters and languages might like to read the W3C's Character Model (currently a working draft) and follow the W3C's International Activity.


Before Change
while len(xp.shape) < xsize: xp = xp[nwxs]
// "upconvert" with a newaxis //XXX: only works correctly for dim=0,1,2 ?
if up: x = x[:,nwxs] if xsize > 0 else x[nwxs]
return abs(x - xp)
def euclidean_distance(x, xp=None, up=True, dmin=0):
1-D euclidean distance between points
After Change
if pair:
return abs(x.T - xp.T).T
xsl = (slice(None),)*xsize + (None,) //NOTE: [:,:,nwxs] for 2-D
xpsl = (slice(None),)*max(0,xsize-1) + (None,) //NOTE: [:,nwxs] for 2-D
return abs(x.T[xsl] - xp.T[xpsl])
def lipschitz_metric(L, x, xp=None):
sum of lipschitz-weighted distance between points


|
Iterator (run)
5000 rows, no HTML replacement
|
|
|
Iterator (run)
5000 rows, with HTML replacement
|
|
|
Iterator (run)
5000 rows, with HTML and on expression
|
|


Object-Oriented Programming: Classes vs. Modules
Key Differences & Purpose of Classes & Modules
November 16, 2014
Inheritance in Ruby allows you to do many nifty things with your code. It allows you to pass on code between different classes so that the subclass inherits methods, variables, and constants from its superclass, so that you don’t have to manually write the same lines of code for each object. However, Ruby doesn’t allow multiple inheritance. This means that your class will only have one superclass, rather than multiple parent classes.
To bypass this single-parent dilemma, Ruby does allow you to implement multiple inheritance through modules. You can access the methods within certain modules as mix-ins. This opens up many possibilities; however, the key is to know when to use a class and when to use a module.
Classes
Classes are constructs that are used to create instances of itself - called class instances or class objects or simply, objects. These instances take on the state and behavior of the class. You use the class to create many of these objects. You can create just a couple or even a million - and none of them will interfere with each other. Essentially, the class provides the code that is common to all potential instances. However, when you instantiate (create) an instance, you can provide more specific inputs. Basically, you add code that makes each unique to that particular instance.
Classes, then, serve as blueprints or templates for creating objects. Its behavior (methods, variables, and constants) are passed to these objects. If you aren’t planning on creating any instances of a class, don’t use class. A module might be a better bet.
 You can think of them kind of like hashes. It operates as a way to map one thing to another. Just like a hash, where you use the key to retrieve the value, you cal module method and variable names on an object to retrieve that function. The key difference from classes is that modules serve to provide methods that you can use across multiple classes.
Modules cannot be instantiated. This means that you won’t ever have an object that mirrors the behavior of a module, like you would with a class. However, when your class includes a module, a proxy superclass is generated in order to provide access to all the module methods (this is where multiple inheritance comes into play). Not only are you inheriting from your superclass, you are now also “inheriting" from the module.


Tutorial – input set¶
In this tutorial, the subparsers of get_poscars=(gp)
and vasp_set=(vs)
are introduced.
Preparation of the unit cell¶
Here, we show how to use vise using an example of ScN. Firstly, we obtain the POSCAR file via Materials Project REST API. (Of course, it’s also fine to prepare POSCAR by another way by yourself instead.) When we use the Materials Project REST API, we need to set the PMG_MAPI_KEY in the .pmgrc.yaml file at the home directory, e.g., See pymatgen web page 1, for more details.
When we check the Materials Project web page, we know the id for ScN is mp-2857.
vise automatically retrieve the POSCAR files using the gp
(= get_poscar
) sub-command.
For example, we can get the crystal structure of ScN. by typing as follows,
vise gp -n 2857
Input files for the cell relaxation¶
Let’s begin with the relaxation of the unit cell using VASP.
For this purpose, we need to prepare INCAR, POTCAR, and KPOINTS files.
In vise, vs
(= vasp_set
) sub-option automatically generates these files.
vs
includes various arguments, and the most important ones are --task
and --xc
,
determining the task and exchange-correlation (XC) functional.
The defaults are structure optimization (structure_opt) for task and PBEsol functional (pbesol) for XC functional.
So we can generate INCAR, POTCAR, and KPOINTS files, by typing as follows at the directory where POSCAR exists,
vise vs
The vs
sub-option has a lot of arguments, such as --potcar
and --kpt_density
.
Some users may want to use their favorite potcar set rather than the vise defaults set.
In this case, it is cumbersome to add --potcar
argument all the time.
To avoid such circumstance, user can use the vise.yaml
file.
See vise.yaml section for details.
Advanced usage of the vasp_set¶
In the arguments of vs
, there are -uis(=user_incar_setting) and -auis(=additional_user_incar_setting) arguments.
The former INCAR setting is set by vise.yaml by default, and if one uses this option, the vise.yaml default setting is overwritten.
Conversely, the latter is set only via this option and it does not overwrite user_incar_setting written in vise.yaml
Please use both the options as the situation demands.


{% extends 'base.html'%} {% block styles%} {{ super() }} {% endblock %}{% block content%}
Pizza Name:
Pizza Amount:
Pizza Price:
Kshs. 2,000


--- layout: post title: Environment Setup for OAuth and XSRF Demonstrations date: 2018-05-10 13:58:04.000000000 +05:30 type: post parent_id: '0' published: true password: '' status: publish categories: - CSRF - SSO - SSS - Web Development tags: - Apache - Laravel meta: _thumbnail_id: '455' _rest_api_published: '1' _rest_api_client_id: "-1" _publicize_job_id: '17689293472' timeline_notification: '1525940884' author: amodsachintha ---
The implementations described in the previous posts listed below were implemented in the Laravel PHP Framework environment within the Apache web server.
XSRF (CSRF) Protection – Double Submit Cookie
XSRF (CSRF) Protection – Synchronizer Token Pattern
Demonstrating OAuth 2.0 using Facebook’s Graph API
The basic environment setup is as follows.
Installing and configuring Apache and enabling SSL is a prerequisite.
Get Composer, a dependency management software for developers (including, but not limited to php) from here.
Create a new Laravel Application using the following command. Make sure to browse into the Document Root of the web server before executing the following command.
composer create-project --prefer-dist laravel/laravel oauth
This will download the Laravel Framework and configure it to run.
Edit the hosts file in Windows to add local DNS resolution for easy usage.
C:\Windows\System32\drivers\etc\hosts <IP_ADDRESS> www.oauthtest.lk
Add a Virtual Host entry in the Apache Server config for SSL
[caption id="attachment_453" align="aligncenter" width="611"] httpd-ssl.conf for the Apache 2.18 server[/caption]
Laravel by default has CSRF Protection enabled using the Synchronizer Token pattern. It would throw exceptions if CSRF token validations failed. Therefore, since we are implementing our OWN CSRF protection functionality, make sure to disable the VerifyCsrfToken class from the HTTP middleware.
C:\Wamp64\www\oauth\app\Http\Kernel.php
[caption id="attachment_454" align="aligncenter" width="528"] VerifyCsrfToken class is commented out[/caption]
For CSRF Protection functionality to work, a user must be first authenticated with the site. Therefore, a simple form of hard-coded credentials in the JSON format was used to implement a LocalLogin class that would authenticate a user.
The users.json file is as follows. Note that the password field is md5 hashed.
[caption id="attachment_457" align="aligncenter" width="433"] users.json[/caption]
The login controller, LocalLogin.php was implemented as follows.
[caption id="attachment_458" align="aligncenter" width="650"] LocalLogin::class[/caption]
The user credentials are read from users.json and is checked against the request data from the login form.
[caption id="attachment_459" align="aligncenter" width="432"] Login page[/caption]
Once the user credentials match, a session is created and a session cookie is set.


From
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
20013
to
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
refugees were
going to:
coming from:
Your browser does not support SVG


19-Apr-2017 | Milku
Don't try this at home.
I came across a paper in Chemical Research in Toxicology, 2007, 20 (4), pp 616–624, entitled ‘Arsenic Metabolism and Thioarsenicals in Hamsters and Rats’. Scientists gave groups of hamsters and rats a single oral dose of arsenite (iAsIII) at 5.0 mg As/kg body weight and then determined where the arsenic dose accumulated and how quickly it was processed.
More than 75% of the dose accumulated in rat red blood cells in the form of dimethylarsinous acid (DMA), whereas less than 0.8% of the dose accumulated in hamster red blood cells, mostly in the form of monomethylarsonous acid (MMA).
More than 63% of the dose was recovered in hamster urine within one week (7.8-fold higher than that in rat urine).
The quantity of arsenic distributed in the liver and kidneys was significantly higher in hamsters than in rats, and arsenic in livers stayed much longer in hamsters than in rats.
Now, I don't know about you, but I think that’s just brutal.
And I’m getting slightly twitchy because I have heard one of my humans talking about chemistry. He’d better not try anything…or at least he should go and find a rat if he’s keen on experimenting.


Gardaí appeal for help in locating woman, 31, missing from Dublin
by By Digital Desk staffGardaí in Dublin are appealing for help in locating a missing 31-year-old woman.
Nikita Mooney has been missing from the Kilmore West area of Dublin 5 since Saturday, December 7.
Nikita is described as being around 5'6" in height with a slim build.
She has bright purple hair and blue eyes.
Anyone who may have seen or has information on Nikita's whereabouts are asked to contact Ballymun Garda Station on 01 6664400, the Garda Confidential Line on 1800 666 111 or any garda station.
READ MORE
Storm Atiyah: Thousands of homes and businesses without power; More stormy weather expected


---
title: "Cancel"
date: 2020-01-10T17:51:45-07:00
draft: false
---
Cancel
Sorry to see you canceled your donation, if there is anything we could do to change your mind, please let us know either by emailing<EMAIL_ADDRESS>or contacting us on Slack


GoT Skills !
Share your potential with friends, colleagues or recruiters, on a platform which is the most convenient to access.
It is as easy as one-step editing your profile, so that you can update your resume whenever you want.
“ Resume reaches the recruiter’s table much before than you do."
So,
Lets make resume which you will be proud to brag about.


--- layout: archive author_profile: true ---
I'm Scala enthusiast with two years of commercial Scala experience (and counting). In these two years I've been working in Agile team on backend systems using Scala, Akka, Spray and other technologies where everything were deployed to AWS. Along this time I've also done some significant UI work using Angular.js and Play Framework. I'm regular attendee of London Scala Users' Group events.
I'm also interested in other functional languages like Haskell or Lisp, but this doesn't mean that I've never done OO programming before.


Vent
About Us
About Us
Unwind the Mind
Unwind the Mind
Just Wanna Talk
Just Wanna Talk
Captive Conscience
Captive Conscience
menu
Unwind Your Mind
Explore creative relaxation methods.
Weave an
intricate silk masterpiece
Build a
beautiful sand creation
Make a
colorful mandala drawing
______________________________________________________________________________________
Experiment with calming home therapies.
Try out the
4-7-8 breathing strategy.
Engage in
deep meditation.
Immerse your senses in
essential oil therapy.
10 Ways to De-Stress
5 Ways to Improve Your Mood
10 Yoga Poses to Feel Calm


Am I a Real Dev?
YES
,
You are a Real Dev 🎉 🎉
check again
share on twitter
NO
,
You are not a Real Dev 😐
check again
share on twitter
Do you create software?
Yes
No


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface JCoServerUnitIDHandler
This interface defines methods to handle a function unit received by a JCoServer
.
Applications providing support for transactional scenarios based on bgRFC communication have
to provide a custom implementation for this interface. The instance implementing this
interface has to be set on the server.
JCoServer.setUnitIDHandler(JCoServerUnitIDHandler)
| Method Summary | |
|---|---|
boolean |
checkUnitID(JCoServerContext serverCtx,
JCoUnitIdentifier unitIdentifier)
This method will be invoked when a bgRFC unit is being sent from an SAP system. |
void |
commit(JCoServerContext serverCtx,
JCoUnitIdentifier unitIdentifier)
This method will be called after all RFC function modules belonging to the concerned unit have been successfully completed. |
void |
confirmUnitID(JCoServerContext serverCtx,
JCoUnitIdentifier unitIdentifier)
This method will be called after the local transaction has been completed. |
JCoFunctionUnitState |
getFunctionUnitState(JCoServerContext serverCtx,
JCoUnitIdentifier unitIdentifier)
The method will be invoked if the ABAP side resumes after a failure in bgRFC scheduler. |
void |
rollback(JCoServerContext serverCtx,
JCoUnitIdentifier unitIdentifier)
This method will be called if an error has occurred in one of the RFC function modules belonging to the concerned unit. |
| Method Detail |
|---|
boolean checkUnitID(JCoServerContext serverCtx, JCoUnitIdentifier unitIdentifier)
serverCtx
- server context describes the server which gets the callunitIdentifier
- unit identifier
void confirmUnitID(JCoServerContext serverCtx, JCoUnitIdentifier unitIdentifier)
serverCtx
- server context describes the server which gets the callunitIdentifier
- unit identifiervoid commit(JCoServerContext serverCtx, JCoUnitIdentifier unitIdentifier)
serverCtx
- server context describes the server which gets the callunitIdentifier
- unit identifiervoid rollback(JCoServerContext serverCtx, JCoUnitIdentifier unitIdentifier)
serverCtx
- server context describes the server which gets the callunitIdentifier
- unit identifierJCoFunctionUnitState getFunctionUnitState(JCoServerContext serverCtx, JCoUnitIdentifier unitIdentifier)
serverCtx
- server context describes the server which gets the callunitIdentifier
- unit identifier
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


fossil add
Put files or directories under Fossil version control.
More information: home page
- Put a file or directory under version control, so it will be in the current checkout:
fossil add path/to/file_or_directory
- Remove all added files from the current checkout:
fossil add --reset


Noah Miller
About
Portfolio
Contact
Portfolio
Project One (WIP)
Project Two (WIP)
Project Three (WIP)
Project Four (WIP)
Project Five (WIP)
Project Six (WIP)


Try to load implicitly relative path after a require. Documented in Issue 722.
Check console for messages


public class WebElementWrapper
extends java.lang.Object
WebElement
class.
It's purpose is to make common tasks easier and catch/fix common problems.
All WebDriver
interactions are Synchronized
on the WebDriverWrapper.LOCK
object.
(The WebDriver
/ Web Browser can only do one thing at a time, just like a real person.)
This allows Multi-Threading to be used with Selenium.
| Modifier and Type | Method and Description |
|---|---|
WebElementWrapper |
blur()
If this
WebElement is in Focus, Focus will be lost. |
boolean |
classContains(java.lang.String _token)
Determines this
WebElement 's "class" Attribute contains the given _token . |
WebElementWrapper |
clearInput()
Calls
WebElement.clear() . |
WebElementWrapper |
click()
Hovers over the
WebElement , then clicks it. |
WebElementWrapper |
click(boolean _waitForRefresh)
Hovers over the
WebElement , then clicks it, and optionally waits for a page refresh. |
WebElementWrapper |
click(double _waitTimeInSeconds)
Waits for this
WebElement to be click-able, hovers over it, then clicks it. |
WebElementWrapper |
click(double _waitTimeInSeconds,
boolean _waitForRefresh)
Waits for this
WebElement to be click-able, hovers over it, clicks it, and optionally waits for a page refresh. |
WebElementWrapper |
controlCommandClick()
Will hold down the
Keys.CONTROL or Keys.COMMAND Key, while performing a click. |
WebElementWrapper |
deselectAll()
Will Un-Select all Option for a Multi-Select
WebElement . |
WebElementWrapper |
doubleClick()
Will perform a "double click" on this Element.
|
WebElementWrapper |
dragTo(int _offsetX,
int _offsetY)
Will do a "click and hold" on this Element and drag it bu the given offsets.
|
WebElementWrapper |
dragTo(WebElementWrapper _destinationElement)
Drags this Element to the middle of the given Element.
|
java.lang.String |
getAttribute(java.lang.String _attributeName)
Will get the value of one of this Element's XML Attributes.
|
java.lang.String |
getCssValue(java.lang.String _propertyName)
Will get the value of one of this Element's CSS Properties.
|
WebElementWrapper |
getDescendant(org.openqa.selenium.By _by)
Waits
WebDriverWrapper.maxElementLoadTime for a descendant WebElement , that match the given search query, to exist and contain the
correct visibility; then grabs that WebElement descendants. |
WebElementWrapper |
getDescendant(org.openqa.selenium.By _by,
boolean _isVisible)
Waits
WebDriverWrapper.maxElementLoadTime for a descendant WebElement , that match the given search query, to exist and contain the
correct visibility; then grabs that WebElement descendants. |
WebElementWrapper |
getDescendant(org.openqa.selenium.By _by,
boolean _isVisible,
java.time.Duration _waitTime)
Waits the given amount of time for a descendant
WebElement , that match the given search query, to exist and contain the correct visibility; then
grabs that WebElement descendants. |
WebElementWrapper |
getDescendant(org.openqa.selenium.By _by,
java.lang.Boolean _isVisible,
java.time.Duration _waitTime,
java.lang.String _notFoundError)
Waits the given amount of time for a descendant
WebElement , that match the given search query, to exist and contain the correct visibility; then
grabs that WebElement descendants. |
WebElementWrapper |
getDescendant(org.openqa.selenium.By _by,
boolean _isVisible,
java.lang.String _notFoundError)
Waits
WebDriverWrapper.maxElementLoadTime for a descendant WebElement , that match the given search query, to exist and contain the
correct visibility; then grabs that WebElement descendants. |
WebElementWrapper |
getDescendant(org.openqa.selenium.By _by,
java.time.Duration _waitTime)
Waits the given amount of time for a descendant
WebElement , that match the given search query, to exist and contain the correct visibility; then
grabs that WebElement descendants. |
WebElementWrapper |
getDescendant(org.openqa.selenium.By _by,
java.time.Duration _waitTime,
java.lang.String _notFoundError)
Waits the given amount of time for a descendant
WebElement , that match the given search query, to exist and contain the correct visibility; then
grabs that WebElement descendants. |
WebElementWrapper |
getDescendant(org.openqa.selenium.By _by,
java.lang.String _notFoundError)
Waits
WebDriverWrapper.maxElementLoadTime for a descendant WebElement , that match the given search query, to exist and contain the
correct visibility; then grabs that WebElement descendants. |
java.util.List<WebElementWrapper> |
getDescendants(org.openqa.selenium.By _by)
Waits
WebDriverWrapper.maxElementLoadTime for at least one descendant WebElement , that match the given search query, to exist and contain
the correct visibility; then grabs all of the available WebElement descendants. |
java.util.List<WebElementWrapper> |
getDescendants(org.openqa.selenium.By _by,
java.lang.Boolean _isVisible)
Waits
WebDriverWrapper.maxElementLoadTime for at least one descendant WebElement , that match the given search query, to exist and contain
the correct visibility; then grabs all of the available WebElement descendants. |
java.util.List<WebElementWrapper> |
getDescendants(org.openqa.selenium.By _by,
java.lang.Boolean _isVisible,
java.time.Duration _waitTime)
Waits the given amount of time for at least one descendant
WebElement , that match the given search query, to exist and contain the correct
visibility; then grabs all of the available WebElement descendants. |
java.util.List<WebElementWrapper> |
getDescendants(org.openqa.selenium.By _by,
java.time.Duration _waitTime)
Waits the given amount of time for at least one descendant
WebElement , that match the given search query, to exist and contain the correct
visibility; then grabs all of the available WebElement descendants. |
java.util.List<java.lang.String> |
getSelectOptionsAvailable()
Gets all of the Select input's Drop-Down's Options.
|
java.util.List<java.lang.String> |
getSelectOptionsSelected()
Gets all of the Select input's Drop-Down's Options that are selected.
|
java.lang.String |
getTagName()
Get the tag name of this
WebElement . |
java.lang.String |
getValue()
Will return the value of this
WebElement regardless of the type. |
WebElementWrapper |
hoverOver()
Scrolls this
WebElement into view and hovers the cursor over the middle of it. |
boolean |
isDisplayed()
Calls
WebElement.isDisplayed() . |
boolean |
isEnabled()
If the
WebElement is enabled and does not have an "disabled" attribute. |
boolean |
isFullyInViewport()
Will return
true if this WebElement is fully inside the current, visible Viewport. |
boolean |
isInFocus()
Determines if this
WebElement is the WebElement that the browser is focused on. |
boolean |
isPartiallyInViewport()
Will return
true if any part of the WebElement is inside the currently Visible Viewport. |
boolean |
isSelected()
Calls
WebElement.isSelected() . |
boolean |
isStale()
Determines if this
WebElement has gone stale. |
WebElementWrapper |
javascriptClick()
Hovers over this
WebElement and clicks it using JavaScript. |
WebElementWrapper |
javascriptClick(boolean _waitForRefresh)
Hovers over this
WebElement and clicks it using JavaScript. |
WebElementWrapper |
keyClick(java.lang.CharSequence _keys)
Will hold down Key(s) while performing a click.
|
void |
rightClick()
Will perform a right click on this element.
|
void |
rightClickAndSelectContextMenuItem(int _downCount)
Will perform a right click on this element send
Keys.DOWN a given number of times, and then send Keys.ENTER . |
WebElementWrapper |
scrollToMiddle()
Will scroll the web page so that this
WebElement 's middle, is in the middle of the viewport (browser window). |
WebElementWrapper |
scrollToTopLeft()
Will scroll the web page so that the
WebElement starts at the top, right corner of the viewport. |
WebElementWrapper |
select(java.lang.String _visibleText)
Sets the value of this Select / Drop-Down
WebElement , by clicking on the Drop-Down then clicking on the correct option and closing the Drop-Down. |
WebElementWrapper |
sendKeys(org.openqa.selenium.Keys... _keys)
Sends a sequence of specialized keys to the
WebElement . |
WebElementWrapper |
sendKeys(java.lang.String _keys)
Sends a sequence of keys to the
WebElement . |
java.lang.String |
toString()
Get's a String representation of this
WebElement . |
java.lang.String |
toString(boolean _prettyPrint)
Get's a String representation of this
WebElement . |
org.w3c.dom.Document |
toXml()
Will convert this
WebElement to an XML Document , with itself as the root. |
void |
uploadFile(java.io.File _file)
Hovers over the
input WebElement and uploads the given file, without using the Operating System's Dialog. |
void |
uploadFolder(java.io.File _folder)
Clicks on this
WebElement to open the Upload Files dialog, goes to the folder, selects all files, and then closes the Upload dialog. |
void |
waitForAttribute(java.lang.String _name)
Waits up to
WebDriverWrapper.maxElementLoadTime , for a given Attribute to exist. |
void |
waitForAttribute(java.lang.String _name,
java.time.Duration _waitTime)
Waits up to the given length of time, for a given Attribute to exist.
|
void |
waitForAttribute(java.lang.String _name,
java.lang.String _value)
Waits up to
WebDriverWrapper.maxElementLoadTime , for a given Attribute to exist and for the value to equal a given value. |
void |
waitForAttribute(java.lang.String _name,
java.lang.String _value,
boolean _caseSensitive)
Waits up to
WebDriverWrapper.maxElementLoadTime , for a given Attribute to exist and for the value to equal a given value. |
void |
waitForAttribute(java.lang.String _name,
java.lang.String _value,
java.time.Duration _waitTime)
Waits up to the given length of time, for a given Attribute to exist and for the value to equal a given value.
|
void |
waitForAttribute(java.lang.String _name,
java.lang.String _value,
java.time.Duration _waitTime,
boolean _caseSensitive)
Waits up to the given length of time, for a given Attribute to exist and for the value to equal a given value.
|
void |
waitForAttribute(java.lang.String _name,
java.lang.String _value,
java.time.Duration _waitTime,
boolean _caseSensitive,
boolean _isEqualTo)
Waits up to the given length of time, for a given Attribute to exist / not exist and/or for the value to equal / not equal a given value.
|
void |
waitForClass(java.lang.String _token)
Waits up to
WebDriverWrapper.maxElementLoadTime , for this Element's @Class attribute to contain a given value. |
void |
waitForClass(java.lang.String _token,
boolean _isEqualTo)
Waits up to
WebDriverWrapper.maxElementLoadTime , for this Element's @Class attribute to contain / not contain a given value. |
void |
waitForClass(java.lang.String _token,
java.time.Duration _waitTime)
Waits up to the given amount of time, for this Element's
@Class attribute to contain a given value. |
void |
waitForClass(java.lang.String _token,
java.time.Duration _waitTime,
boolean _isEqualTo)
Waits up to the given amount of time, for this Element's
@Class attribute to contain / not contain a given value. |
void |
waitForClickable(double _waitTimeInSeconds)
Waits up to the given amount of time for this Web Element to be
click-able (i.e.
|
void |
waitForUnload(java.time.Duration _waitTime)
Waits, up to the given length of time, for this Web Element to be removed from the DOM.
|
void |
waitForValue(java.lang.String _value,
boolean _caseSensitive)
Waits up to
WebDriverWrapper.maxElementLoadTime , for this Element's value to equal a given value. |
void |
waitForValue(java.lang.String _value,
java.time.Duration _waitTime)
Waits up to the given length of time, for this Element's value to equal a given value.
|
void |
waitForValue(java.lang.String _value,
java.time.Duration _waitTime,
boolean _caseSensitive)
Waits up to the given length of time, for this Element's value to equal a given value.
|
void |
waitForValue(java.lang.String _value,
java.time.Duration _waitTime,
boolean _caseSensitive,
boolean _isEqualTo)
Waits up to the given length of time, for this Element's value to equal / not equal a given value.
|
void |
waitForVisibility()
Waits up to
WebDriverWrapper.maxElementLoadTime , for this Web Element to become visible. |
void |
waitForVisibility(boolean _visible)
Waits up to
WebDriverWrapper.maxElementLoadTime , for this Web Element to become visible/invisible. |
void |
waitForVisibility(boolean _visible,
java.time.Duration _waitTime)
Waits up to the given length of time, for this Web Element to become visible/invisible.
|
void |
waitForVisibility(java.time.Duration _waitTime)
Waits up to the given length of time, for this Web Element to become visible.
|
static java.lang.String |
webElementToStringToXpath(java.lang.String _webElementToString)
This method will take in a
WebElement 's "toString" and come up with an XPath to locate the WebElement in the DOM. |
public static java.lang.String webElementToStringToXpath(java.lang.String _webElementToString)
WebElement
's "toString" and come up with an XPath to locate the WebElement
in the DOM._webElementToString
- The result of calling a WebElement
's "toString" function.WebElement
in the DOM.
(Note: XPath is "best guess".)
public WebElementWrapper blur()
WebElement
is in Focus, Focus will be lost.WebElementWrapper
for function call chain-ability.public boolean classContains(java.lang.String _token)
WebElement
's "class" Attribute contains the given _token
.
Uses Word Breaks to ensure that it doesn't match other (super-string) tokens.
_token
- The word to match.true
, if the _token
was found.public WebElementWrapper clearInput()
WebElement.clear()
.WebElementWrapper
for function call chain-ability.WebElement.clear()
public WebElementWrapper click()
WebElement
, then clicks it.
Note: If the WebElement
is not visible in the browser's viewport, it will be scrolled to the middle of the viewport.
Same as calling click(boolean)
with a value of false
.
Known Issues: Some WebElement
s do not work with Selenium's built-in click() function.
In those cases, use javascriptClick()
.
Known WebElement
s that need a Javascript Click:
- Bootstrap's Date-Time Picker Widget
WebElementWrapper
for function call chain-ability.org.openqa.selenium.WebDriverException
- If the WebElement
is covered, and another WebElement
would receive the click.public WebElementWrapper click(boolean _waitForRefresh)
WebElement
, then clicks it, and optionally waits for a page refresh.
Note: If the WebElement
is not visible in the browser's viewport, it will be scrolled to the middle of the viewport.
Known Issues: Some WebElement
s do not work with Selenium's built-in click() function.
In those cases, use javascriptClick()
.
Known WebElement
s that need a Javascript Click:
- Bootstrap's Date-Time Picker Widget
_waitForRefresh
- Whether to wait for a page reload, after the click.WebElementWrapper
for function call chain-ability.org.openqa.selenium.TimeoutException
- If the page never unloads, or if the page does not finish loading in WebDriverWrapper.maxPageLoadTime
.org.openqa.selenium.WebDriverException
- If the WebElement
is covered, and another WebElement
would receive the click.WebDriverWrapper.waitForPageLoad()
public WebElementWrapper click(double _waitTimeInSeconds)
WebElement
to be click-able, hovers over it, then clicks it.
Note: If the WebElement
is not visible in the browser's viewport, it will be scrolled to the middle of the viewport.
Known Issues: Some WebElement
s do not work with Selenium's built-in click() function.
In those cases, use javascriptClick()
.
Known WebElement
s that need a Javascript Click:
- Bootstrap's Date-Time Picker Widget
_waitTimeInSeconds
- The maximum amount of time to wait for this WebElement
to be click-able (truncated to a long
).WebElementWrapper
for function call chain-ability.java.lang.IllegalArgumentException
- If _waitTimeInSeconds < 0
.org.openqa.selenium.TimeoutException
- If this WebElement
is not click-able after _waitTimeInSeconds
seconds.waitForClickable(double)
public WebElementWrapper click(double _waitTimeInSeconds, boolean _waitForRefresh)
WebElement
to be click-able, hovers over it, clicks it, and optionally waits for a page refresh.
Note: If the WebElement
is not visible in the browser's viewport, it will be scrolled to the middle of the viewport.
Known Issues: Some WebElement
s do not work with Selenium's built-in click() function.
In those cases, use javascriptClick()
.
Known WebElement
s that need a Javascript Click:
- Bootstrap's Date-Time Picker Widget
_waitTimeInSeconds
- The Maximum amount of time to wait for this WebElement
to be click-able (truncated to a long
)._waitForRefresh
- Whether to wait for a page reload, after the click.WebElementWrapper
for function call chain-ability.java.lang.IllegalArgumentException
- If _waitTimeInSeconds < 0
.org.openqa.selenium.TimeoutException
- If this WebElement
is not click-able after _waitTimeInSeconds
.
Or if the page never unloads, or if the page does not finish loading in WebDriverWrapper.maxPageLoadTime
seconds.
waitForClickable(double)
public WebElementWrapper controlCommandClick()
Keys.CONTROL
or Keys.COMMAND
Key, while performing a click.
Note: Keys.COMMAND
for Mac and Keys.CONTROL
for everything else.
WebElementWrapper
for function call chain-ability.keyClick(CharSequence)
public WebElementWrapper keyClick(java.lang.CharSequence _keys)
_keys
- The Keys
or Keys.chord(CharSequence...)
to hold down, while performing the click.WebElementWrapper
for function call chain-ability.java.lang.IllegalArgumentException
- If the given Keys are null
.click()
public WebElementWrapper deselectAll()
WebElement
.WebElementWrapper
for function call chain-ability.org.openqa.selenium.support.ui.UnexpectedTagNameException
- If this WebElement
is not a Select.java.lang.UnsupportedOperationException
- If the Select does not support multiple selectionspublic WebElementWrapper doubleClick()
WebElementWrapper
, for method call chaining purposes.public WebElementWrapper dragTo(WebElementWrapper _destinationElement)
_destinationElement
- Where to drag this Element to.WebElementWrapper
for function call chain-ability.public WebElementWrapper dragTo(int _offsetX, int _offsetY)
_offsetX
- How far to drag it horizontally, in pixels (px)._offsetY
- How far to drag it vertically, in pixels (px).WebElementWrapper
for function call chain-ability.public java.lang.String getAttribute(java.lang.String _attributeName)
Note: For CSS Properties use getCssValue(String)
.
_attributeName
- The name of the Attribute value to return.null
, if the Attribute does not exist.java.lang.IllegalArgumentException
- If the given Attribute Name is blank.WebElement.getAttribute(String)
,
getCssValue(String)
public java.lang.String getCssValue(java.lang.String _propertyName)
Note: For XML Attributes use getAttribute(String)
.
_propertyName
- The name of the Properties value to return.null
, if the Properties is not set.java.lang.IllegalArgumentException
- If the given Properties Name is blank.WebElement.getCssValue(String)
,
getAttribute(String)
public WebElementWrapper getDescendant(org.openqa.selenium.By _by)
WebDriverWrapper.maxElementLoadTime
for a descendant WebElement
, that match the given search query, to exist and contain the
correct visibility; then grabs that WebElement
descendants._by
- How to search for the descendant.
If looking for a direct decedent, do NOT start with the CSS "child combinator" selector (>). This CSS selector MUST be preceded by a parent query.Instead use an XPath starting with "./".
Note: XPaths starting with "//" will be updated to start with ".//".
null
, if no such
descendant was found.java.lang.IllegalArgumentException
- If the given By
object is null
.
Or if the given By
object is a CSS Selector starts with ">".
org.openqa.selenium.NoSuchElementException
- If no Web Element is found, and the _notFoundError
argument is not null
.TooManyResultsException
- If more than one descendant is found.public WebElementWrapper getDescendant(org.openqa.selenium.By _by, boolean _isVisible)
WebDriverWrapper.maxElementLoadTime
for a descendant WebElement
, that match the given search query, to exist and contain the
correct visibility; then grabs that WebElement
descendants._by
- How to search for the descendant.
If looking for a direct decedent, do NOT start with the CSS "child combinator" selector (>). This CSS selector MUST be preceded by a parent query.Instead use an XPath starting with "./".
Note: XPaths starting with "//" will be updated to start with ".//".
_isVisible
- If set to true
, grabs only a visible Web Element. If set to false
, grabs only a hidden Web Element. If null
, grabs a Web
Element with any visibility.null
, if no such
descendant was found.java.lang.IllegalArgumentException
- If the given By
object is null
.
Or if the given By
object is a CSS Selector starts with ">".
org.openqa.selenium.NoSuchElementException
- If no Web Element is found, and the _notFoundError
argument is not null
.TooManyResultsException
- If more than one descendant is found.public WebElementWrapper getDescendant(org.openqa.selenium.By _by, java.time.Duration _waitTime)
WebElement
, that match the given search query, to exist and contain the correct visibility; then
grabs that WebElement
descendants._by
- How to search for the descendant.
If looking for a direct decedent, do NOT start with the CSS "child combinator" selector (>). This CSS selector MUST be preceded by a parent query.Instead use an XPath starting with "./".
Note: XPaths starting with "//" will be updated to start with ".//".
_waitTime
- How long to wait for the descendant WebElement
to exists and contain the correct visibility.
Pass in 0
to only try to get the descendant WebElement
once.
null
, if no such
descendant was found.java.lang.IllegalArgumentException
- If the given By
object is null
.
If the given By
object is a CSS Selector starts with ">".
Or if the given Wait Time is negative.
org.openqa.selenium.NoSuchElementException
- If no Web Element is found, and the _notFoundError
argument is not null
.TooManyResultsException
- If more than one descendant is found.public WebElementWrapper getDescendant(org.openqa.selenium.By _by, java.lang.String _notFoundError)
WebDriverWrapper.maxElementLoadTime
for a descendant WebElement
, that match the given search query, to exist and contain the
correct visibility; then grabs that WebElement
descendants._by
- How to search for the descendant.
If looking for a direct decedent, do NOT start with the CSS "child combinator" selector (>). This CSS selector MUST be preceded by a parent query.Instead use an XPath starting with "./".
Note: XPaths starting with "//" will be updated to start with ".//".
_notFoundError
- If not null
, a NoSuchElementException
will be thrown with this message, if no Element is found. (A screenshot will also be
taken.)null
, if no such
descendant was found.java.lang.IllegalArgumentException
- If the given By
object is null
.
Or if the given By
object is a CSS Selector starts with ">".
org.openqa.selenium.NoSuchElementException
- If no Web Element is found, and the _notFoundError
argument is not null
.TooManyResultsException
- If more than one descendant is found.public WebElementWrapper getDescendant(org.openqa.selenium.By _by, boolean _isVisible, java.time.Duration _waitTime)
WebElement
, that match the given search query, to exist and contain the correct visibility; then
grabs that WebElement
descendants._by
- How to search for the descendant.
If looking for a direct decedent, do NOT start with the CSS "child combinator" selector (>). This CSS selector MUST be preceded by a parent query.Instead use an XPath starting with "./".
Note: XPaths starting with "//" will be updated to start with ".//".
_isVisible
- If set to true
, grabs only a visible Web Element. If set to false
, grabs only a hidden Web Element. If null
, grabs a Web
Element with any visibility._waitTime
- How long to wait for the descendant WebElement
to exists and contain the correct visibility.
Pass in 0
to only try to get the descendant WebElement
once.
null
, if no such
descendant was found.java.lang.IllegalArgumentException
- If the given By
object is null
.
If the given By
object is a CSS Selector starts with ">".
Or if the given Wait Time is negative.
org.openqa.selenium.NoSuchElementException
- If no Web Element is found, and the _notFoundError
argument is not null
.TooManyResultsException
- If more than one descendant is found.public WebElementWrapper getDescendant(org.openqa.selenium.By _by, boolean _isVisible, java.lang.String _notFoundError)
WebDriverWrapper.maxElementLoadTime
for a descendant WebElement
, that match the given search query, to exist and contain the
correct visibility; then grabs that WebElement
descendants._by
- How to search for the descendant.
If looking for a direct decedent, do NOT start with the CSS "child combinator" selector (>). This CSS selector MUST be preceded by a parent query.Instead use an XPath starting with "./".
Note: XPaths starting with "//" will be updated to start with ".//".
_isVisible
- If set to true
, grabs only a visible Web Element. If set to false
, grabs only a hidden Web Element. If null
, grabs a Web
Element with any visibility._notFoundError
- If not null
, a NoSuchElementException
will be thrown with this message, if no Element is found. (A screenshot will also be
taken.)null
, if no such
descendant was found.java.lang.IllegalArgumentException
- If the given By
object is null
.
Or if the given By
object is a CSS Selector starts with ">".
org.openqa.selenium.NoSuchElementException
- If no Web Element is found, and the _notFoundError
argument is not null
.TooManyResultsException
- If more than one descendant is found.public WebElementWrapper getDescendant(org.openqa.selenium.By _by, java.time.Duration _waitTime, java.lang.String _notFoundError)
WebElement
, that match the given search query, to exist and contain the correct visibility; then
grabs that WebElement
descendants._by
- How to search for the descendant.
If looking for a direct decedent, do NOT start with the CSS "child combinator" selector (>). This CSS selector MUST be preceded by a parent query.Instead use an XPath starting with "./".
Note: XPaths starting with "//" will be updated to start with ".//".
_waitTime
- How long to wait for the descendant WebElement
to exists and contain the correct visibility.
Pass in 0
to only try to get the descendant WebElement
once.
_notFoundError
- If not null
, a NoSuchElementException
will be thrown with this message, if no Element is found. (A screenshot will also be
taken.)null
, if no such
descendant was found.java.lang.IllegalArgumentException
- If the given By
object is null
.
If the given By
object is a CSS Selector starts with ">".
Or if the given Wait Time is negative.
org.openqa.selenium.NoSuchElementException
- If no Web Element is found, and the _notFoundError
argument is not null
.TooManyResultsException
- If more than one descendant is found.public WebElementWrapper getDescendant(org.openqa.selenium.By _by, java.lang.Boolean _isVisible, java.time.Duration _waitTime, java.lang.String _notFoundError)
WebElement
, that match the given search query, to exist and contain the correct visibility; then
grabs that WebElement
descendants._by
- How to search for the descendant.
If looking for a direct decedent, do NOT start with the CSS "child combinator" selector (>). This CSS selector MUST be preceded by a parent query.Instead use an XPath starting with "./".
Note: XPaths starting with "//" will be updated to start with ".//".
_isVisible
- If set to true
, grabs only a visible Web Element. If set to false
, grabs only a hidden Web Element. If null
, grabs a Web
Element with any visibility._waitTime
- How long to wait for the descendant WebElement
to exists and contain the correct visibility.
Pass in 0
to only try to get the descendant WebElement
once.
_notFoundError
- If not null
, a NoSuchElementException
will be thrown with this message, if no Element is found. (A screenshot will also be
taken.)null
, if no such
descendant was found.java.lang.IllegalArgumentException
- If the given By
object is null
.
If the given By
object is a CSS Selector starts with ">".
Or if the given Wait Time is negative.
org.openqa.selenium.NoSuchElementException
- If no Web Element is found, and the _notFoundError
argument is not null
.TooManyResultsException
- If more than one descendant is found.public java.util.List<WebElementWrapper> getDescendants(org.openqa.selenium.By _by)
WebDriverWrapper.maxElementLoadTime
for at least one descendant WebElement
, that match the given search query, to exist and contain
the correct visibility; then grabs all of the available WebElement
descendants._by
- How to search for the descendants.
If looking for a direct decedent, do NOT start with the CSS "child combinator" selector (>). This CSS selector MUST be preceded by a parent query.Instead use an XPath starting with "./".
Note: XPaths starting with "//" will be updated to start with ".//".
java.lang.IllegalArgumentException
- If the given By
object is null
.
Or if the given By
object is a CSS Selector starts with ">".
public java.util.List<WebElementWrapper> getDescendants(org.openqa.selenium.By _by, java.lang.Boolean _isVisible)
WebDriverWrapper.maxElementLoadTime
for at least one descendant WebElement
, that match the given search query, to exist and contain
the correct visibility; then grabs all of the available WebElement
descendants._by
- How to search for the descendants.
If looking for a direct decedent, do NOT start with the CSS "child combinator" selector (>). This CSS selector MUST be preceded by a parent query.Instead use an XPath starting with "./".
Note: XPaths starting with "//" will be updated to start with ".//".
_isVisible
- If set to true, grabs only visible Web Elements. If set to false, grabs only hidden Web Elements. If null, all Web Elements are returned.java.lang.IllegalArgumentException
- If the given By
object is null
.
Or if the given By
object is a CSS Selector starts with ">".
public java.util.List<WebElementWrapper> getDescendants(org.openqa.selenium.By _by, java.time.Duration _waitTime)
WebElement
, that match the given search query, to exist and contain the correct
visibility; then grabs all of the available WebElement
descendants._by
- How to search for the descendants.
If looking for a direct decedent, do NOT start with the CSS "child combinator" selector (>). This CSS selector MUST be preceded by a parent query.Instead use an XPath starting with "./".
Note: XPaths starting with "//" will be updated to start with ".//".
_waitTime
- How long to wait for the WebElement
to exists and contain the correct visibility.
Pass in 0
to only try to get the Elements once.
java.lang.IllegalArgumentException
- If the given By
object is null
.
If the given By
object is a CSS Selector starts with ">".
Or if the given Wait Time is negative.
public java.util.List<WebElementWrapper> getDescendants(org.openqa.selenium.By _by, java.lang.Boolean _isVisible, java.time.Duration _waitTime)
WebElement
, that match the given search query, to exist and contain the correct
visibility; then grabs all of the available WebElement
descendants._by
- How to search for the descendants.
If looking for a direct decedent, do NOT start with the CSS "child combinator" selector (>). This CSS selector MUST be preceded by a parent query.Instead use an XPath starting with "./".
Note: XPaths starting with "//" will be updated to start with ".//".
_isVisible
- If set to true, grabs only visible Web Elements. If set to false, grabs only hidden Web Elements. If null, all Web Elements are returned._waitTime
- How long to wait for the WebElement
to exists and contain the correct visibility.
Pass in 0
to only try to get the Elements once.
java.lang.IllegalArgumentException
- If the given By
object is null
.
If the given By
object is a CSS Selector starts with ">".
Or if the given Wait Time is negative.
public java.util.List<java.lang.String> getSelectOptionsAvailable()
<String>
of all of the Drop-Down's Options' Texts.org.openqa.selenium.support.ui.UnexpectedTagNameException
- If this WebElement
is not a Select / Drop-Down.public java.util.List<java.lang.String> getSelectOptionsSelected()
<String>
of all of the Drop-Down's Options' Texts that are selected..org.openqa.selenium.support.ui.UnexpectedTagNameException
- If this WebElement
is not a Select / Drop-Down.public java.lang.String getTagName()
WebElement
.
(Not the value of the name attribute. i.e. Will return "input" for the WebElement
<input name="foo" />
.)WebElement
.public java.lang.String getValue()
WebElement
regardless of the type.
null
is returned.getSelectOptionsSelected()
to get all values in List format.)Note: If returning the Visible Text, the Element will be scrolled to first.
WebElement
.public WebElementWrapper hoverOver()
WebElement
into view and hovers the cursor over the middle of it.WebElementWrapper
for function call chain-ability.Actions.moveToElement(WebElement)
public boolean isDisplayed()
WebElement.isDisplayed()
.true
if this WebElement
is visible in the web page (It may not be scrolled to.)WebElement.isDisplayed()
public boolean isEnabled()
WebElement
is enabled and does not have an "disabled" attribute.true
if the WebElement
is enabled, false
otherwise.WebElement.isEnabled()
public boolean isFullyInViewport()
true
if this WebElement
is fully inside the current, visible Viewport.
(i.e. The part of the page that is currently being displayed by the browser.)true
, if the WebElement
is fully in view.public boolean isInFocus()
WebElement
is the WebElement
that the browser is focused on.true
, if this WebElement
is the one in focus.public boolean isPartiallyInViewport()
true
if any part of the WebElement
is inside the currently Visible Viewport.
(i.e. The part of the page that is currently being displayed by the browser.)true
, if the WebElement
is partially in view.public boolean isSelected()
WebElement.isSelected()
.true
if the WebElement
is currently selected or checked, false
otherwise.WebElement.isSelected()
public boolean isStale()
WebElement
has gone stale.true
if this WebElement
is stale, otherwise returns false
.public WebElementWrapper javascriptClick()
WebElement
and clicks it using JavaScript.
(This is helpful for WebElement
s that do not work with Selenium's built-in WebElement.click()
function.)
Known WebElement
s that need a JavaScript click:
- Bootstrap's Date-Time Picker Widget
Note: If the WebElement
is not visible in the viewport, it will be scrolled to the middle of the viewport.
Known Issues: Some WebElement
s do not work with a JavaScript click. For those Elements use the normal click()
function.
Known WebElement
s:
WebElementWrapper
for function call chain-ability.org.openqa.selenium.WebDriverException
- If the WebElement
is covered, and another WebElement
would receive the click.public WebElementWrapper javascriptClick(boolean _waitForRefresh)
WebElement
and clicks it using JavaScript.
(This is helpful for WebElement
s that do not work with Selenium's built-in WebElement.click()
function.)
Known WebElement
s that need a JavaScript click:
- Bootstrap's Date-Time Picker Widget
Note: If the WebElement
is not visible in the viewport, it will be scrolled to the middle of the viewport.
Known Issues: Some WebElement
s do not work with a JavaScript click. For those Elements use the normal click()
function.
Known WebElement
s:
_waitForRefresh
- If true
, this method will wait for a page reload.WebElementWrapper
for function call chain-ability.org.openqa.selenium.TimeoutException
- If the page never unloads, or if the page does not finish loading in WebDriverWrapper.maxPageLoadTime
.org.openqa.selenium.WebDriverException
- If the WebElement
is covered, and another WebElement
would receive the click.WebDriverWrapper.waitForPageLoad()
public void rightClick()
Keys.UP
and Keys.DOWN
to this element.Keys.ENTER
to this element.Keys.ESCAPE
to this element.Note: Chrome and Firefox can only work with custom Context Menus. (Not the browser's Context Menu.)
public void rightClickAndSelectContextMenuItem(int _downCount)
Keys.DOWN
a given number of times, and then send Keys.ENTER
.
Note: Chrome and Firefox can only work with custom Context Menus. (Not the browser's Context Menu.)
_downCount
- The number of times to press Keys.DOWN
.
(Note: The first send of Keys.DOWN
will select the top level item in the Context Menu.java.lang.IllegalArgumentException
- If the given Down Count is < 1!public WebElementWrapper select(java.lang.String _visibleText)
WebElement
, by clicking on the Drop-Down then clicking on the correct option and closing the Drop-Down.
Note: If this is a Multi-Select, the Option will be added to those already selected.
Note: If the Drop-Down WebElement
is not visible on the page, it is scrolled to.
_visibleText
- The Select / Drop-Down Option's visible text.WebElementWrapper
for function call chain-ability.java.lang.IllegalArgumentException
- If the given _visibleText
is null
.org.openqa.selenium.NoSuchElementException
- If the Option does not exists.TooManyResultsException
- If more than 1 Option has the given text.org.openqa.selenium.support.ui.UnexpectedTagNameException
- If this WebElement
is not a Select / Drop-Down.public WebElementWrapper scrollToMiddle()
WebElement
's middle, is in the middle of the viewport (browser window).WebElementWrapper
for function call chain-ability.public WebElementWrapper scrollToTopLeft()
WebElement
starts at the top, right corner of the viewport.WebElementWrapper
for function call chain-ability.public WebElementWrapper sendKeys(org.openqa.selenium.Keys... _keys)
WebElement
. (Keys are sent one at a time.)
Note: To send multiple keys at once, use sendKeys(String)
and send Keys.chord(CharSequence...)
.
Note: If the WebElement
is not visible in the viewport, it will be scrolled to the top, left of the viewport.
Note: If the WebElement
is not selected, this will click on it first.
_keys
- What characters to send to the WebElement
.WebElementWrapper
for function call chain-ability.java.lang.IllegalArgumentException
- If the given _keys
is null.public WebElementWrapper sendKeys(java.lang.String _keys)
WebElement
. (Keys are sent one at a time.)
Note: To send multiple keys at once, send Keys.chord(CharSequence...)
for _keys
.
Note: If the WebElement
is not visible in the viewport, it will be scrolled to the top, left of the viewport.
Note: If the WebElement
is not selected, this will click on it first.
_keys
- What characters to send to the WebElement
.WebElementWrapper
for function call chain-ability.java.lang.IllegalArgumentException
- If the given _keys
is null.public java.lang.String toString()
WebElement
. (not formatted)toString
in class java.lang.Object
WebElement
's Outer HTML as a String.org.openqa.selenium.JavascriptException
- If the Javascript command to get the "Outer HTML" fails.public java.lang.String toString(boolean _prettyPrint)
WebElement
._prettyPrint
- Whether or not to try and apply "pretty print" format to the returning String.
If false
, then the formatting will be an exact copy of the HTML page.WebElement
's Outer HTML as a String.org.openqa.selenium.JavascriptException
- If the Javascript command to get the "Outer HTML" fails.public org.w3c.dom.Document toXml()
WebElement
to an XML Document
, with itself as the root.WebElement
.XmlException
- If the HTML could not be converted to an XML.public void uploadFile(java.io.File _file)
input
WebElement
and uploads the given file, without using the Operating System's Dialog.
Note: Selenium does not support Multiple File uploads at the same time, as of v2.53.0. You will have to loop over your list of files and upload them one at a time.
_file
- The File
to upload.java.lang.IllegalArgumentException
- If the _file
is null
, does not exist, or is a folder.InvalidTypeException
- If this WebElement
is not a File Input.public void uploadFolder(java.io.File _folder)
WebElement
to open the Upload Files dialog, goes to the folder, selects all files, and then closes the Upload dialog.
Note: Focus must not be changed during this method.
(Because this uses the java.awt.Robot
class.)
_folder
- The Folder to upload all of the files out of.java.lang.IllegalArgumentException
- If the _folder
is null
, does not exist, or is a file.public void waitForUnload(java.time.Duration _waitTime)
_waitTime
- How long to wait.org.openqa.selenium.TimeoutException
- If this Web Element is not removed from the DOM in the given amount of time.public void waitForAttribute(java.lang.String _name)
WebDriverWrapper.maxElementLoadTime
, for a given Attribute to exist._name
- The name of the Attribute to look for.java.lang.IllegalArgumentException
- If the given Attribute Name is blank.org.openqa.selenium.TimeoutException
- If this Web Element's Attribute does not change in the given amount of time.public void waitForAttribute(java.lang.String _name, java.time.Duration _waitTime)
Note: Both the actual value and the given value are trimmed before comparing.
_name
- The name of the Attribute to look for._waitTime
- How long to wait for the change to occur.java.lang.IllegalArgumentException
- If the given Attribute Name is blank.
Or if the given Wait Time is negative.
org.openqa.selenium.TimeoutException
- If this Web Element's Attribute does not change in the given amount of time.public void waitForAttribute(java.lang.String _name, java.lang.String _value)
WebDriverWrapper.maxElementLoadTime
, for a given Attribute to exist and for the value to equal a given value.
Note: Both the actual value and the given value are trimmed before comparing.
_name
- The name of the Attribute to look for._value
- The value to compare against; or if null
, this method will just look for the existence of the given Attribute.java.lang.IllegalArgumentException
- If the given Attribute Name is blank.org.openqa.selenium.TimeoutException
- If this Web Element's Attribute does not change in the given amount of time.public void waitForAttribute(java.lang.String _name, java.lang.String _value, boolean _caseSensitive)
WebDriverWrapper.maxElementLoadTime
, for a given Attribute to exist and for the value to equal a given value.
Note: Both the actual value and the given value are trimmed before comparing.
_name
- The name of the Attribute to look for._value
- The value to compare against; or if null
, this method will just look for the existence of the given Attribute._caseSensitive
- If true
, String.equals(Object)
is used; else if false
, String.equalsIgnoreCase(String)
is used.java.lang.IllegalArgumentException
- If the given Attribute Name is blank.org.openqa.selenium.TimeoutException
- If this Web Element's Attribute does not change in the given amount of time.public void waitForAttribute(java.lang.String _name, java.lang.String _value, java.time.Duration _waitTime)
Note: Both the actual value and the given value are trimmed before comparing.
_name
- The name of the Attribute to look for._value
- The value to compare against; or if null
, this method will just look for the existence of the given Attribute._waitTime
- How long to wait for the change to occur.java.lang.IllegalArgumentException
- If the given Attribute Name is blank.
Or if the given Wait Time is negative.
org.openqa.selenium.TimeoutException
- If this Web Element's Attribute does not change in the given amount of time.public void waitForAttribute(java.lang.String _name, java.lang.String _value, java.time.Duration _waitTime, boolean _caseSensitive)
Note: Both the actual value and the given value are trimmed before comparing.
_name
- The name of the Attribute to look for._value
- The value to compare against; or if null
, this method will just look for the existence/non-existence of the given Attribute._waitTime
- How long to wait for the change to occur._caseSensitive
- If true
, String.equals(Object)
is used; else if false
, String.equalsIgnoreCase(String)
is used.java.lang.IllegalArgumentException
- If the given Attribute Name is blank.
Or if the given Wait Time is negative.
org.openqa.selenium.TimeoutException
- If this Web Element's Attribute does not change in the given amount of time.public void waitForAttribute(java.lang.String _name, java.lang.String _value, java.time.Duration _waitTime, boolean _caseSensitive, boolean _isEqualTo)
Note: Both the actual value and the given value are trimmed before comparing.
_name
- The name of the Attribute to look for._value
- The value to compare against; or if null
, this method will just look for the existence/non-existence of the given Attribute._waitTime
- How long to wait for the change to occur._caseSensitive
- If true
, String.equals(Object)
is used; else if false
, String.equalsIgnoreCase(String)
is used._isEqualTo
- If true
, waits for the value to equal the given value; else if false
, waits for the value to not equal the given value.java.lang.IllegalArgumentException
- If the given Attribute Name is blank.
Or if the given Wait Time is negative.
org.openqa.selenium.TimeoutException
- If this Web Element's Attribute does not change in the given amount of time.public void waitForClass(java.lang.String _token)
WebDriverWrapper.maxElementLoadTime
, for this Element's @Class
attribute to contain a given value._token
- The value to compare against.java.lang.IllegalArgumentException
- If the given Token is blank.org.openqa.selenium.TimeoutException
- If this Web Element's @Class
attribute does not change in the given amount of time.public void waitForClass(java.lang.String _token, boolean _isEqualTo)
WebDriverWrapper.maxElementLoadTime
, for this Element's @Class
attribute to contain / not contain a given value._token
- The value to compare against._isEqualTo
- If true
, waits for contains; or if false
, waits for does not contain.java.lang.IllegalArgumentException
- If the given Token is blank.org.openqa.selenium.TimeoutException
- If this Web Element's @Class
attribute does not change in the given amount of time.public void waitForClass(java.lang.String _token, java.time.Duration _waitTime)
@Class
attribute to contain a given value._token
- The value to compare against._waitTime
- How long to wait for the change to occur.java.lang.IllegalArgumentException
- If the given Token is blank.
Or if the given _waitTime is < 0
.
org.openqa.selenium.TimeoutException
- If this Web Element's @Class
attribute does not change in the given amount of time.public void waitForClass(java.lang.String _token, java.time.Duration _waitTime, boolean _isEqualTo)
@Class
attribute to contain / not contain a given value._token
- The value to compare against._waitTime
- How long to wait for the change to occur._isEqualTo
- If true
, waits for contains; or if false
, waits for does not contain.java.lang.IllegalArgumentException
- If the given Token is blank.
Or if the given _waitTime is < 0
.
org.openqa.selenium.TimeoutException
- If this Web Element's @Class
attribute does not change in the given amount of time.public void waitForClickable(double _waitTimeInSeconds)
_waitTimeInSeconds
- The Maximum amount of time to wait for this Web Element to be
click-able (truncated to a long
).java.lang.IllegalArgumentException
- If _waitTimeInSeconds < 0
.org.openqa.selenium.TimeoutException
- If this Web Element is not click-able after
_waitTimeInSeconds
.public void waitForValue(java.lang.String _value, boolean _caseSensitive)
WebDriverWrapper.maxElementLoadTime
, for this Element's value to equal a given value.
Note: Both the actual value and the given value are trimmed before comparing.
_value
- The value to compare against._caseSensitive
- If true
, String.equals(Object)
is used; else if false
, String.equalsIgnoreCase(String)
is used.java.lang.IllegalArgumentException
- If the given Value is null
.org.openqa.selenium.TimeoutException
- If this Web Element's Value does not change in the given amount of time.public void waitForValue(java.lang.String _value, java.time.Duration _waitTime)
Note: Both the actual value and the given value are trimmed before comparing.
_value
- The value to compare against._waitTime
- How long to wait for the change to occur.java.lang.IllegalArgumentException
- If the given Value is null
.
Or if the given Wait Time is < 0
.
org.openqa.selenium.TimeoutException
- If this Web Element's Value does not change in the given amount of time.public void waitForValue(java.lang.String _value, java.time.Duration _waitTime, boolean _caseSensitive)
Note: Both the actual value and the given value are trimmed before comparing.
_value
- The value to compare against._waitTime
- How long to wait for the change to occur._caseSensitive
- If true
, String.equals(Object)
is used; else if false
, String.equalsIgnoreCase(String)
is used.java.lang.IllegalArgumentException
- If the given Value is null
.
Or if the given Wait Time is < 0
.
org.openqa.selenium.TimeoutException
- If this Web Element's Value does not change in the given amount of time.public void waitForValue(java.lang.String _value, java.time.Duration _waitTime, boolean _caseSensitive, boolean _isEqualTo)
Note: Both the actual value and the given value are trimmed before comparing.
_value
- The value to compare against._waitTime
- How long to wait for the change to occur._caseSensitive
- If true
, String.equals(Object)
is used; else if false
, String.equalsIgnoreCase(String)
is used._isEqualTo
- If true
, waits for the value to equal the given value; else if false
, waits for the value to not equal the given value.java.lang.IllegalArgumentException
- If the given Value is null
.
Or if the given Wait Time is < 0
.
org.openqa.selenium.TimeoutException
- If this Web Element's Value does not change in the given amount of time.public void waitForVisibility()
WebDriverWrapper.maxElementLoadTime
, for this Web Element to become visible.
Note: If waiting for Invisibility, a Stale Element will be treated as Invisible.
org.openqa.selenium.TimeoutException
- If this Web Element's Visibility does not change in the given amount of time.public void waitForVisibility(boolean _visible)
WebDriverWrapper.maxElementLoadTime
, for this Web Element to become visible/invisible.
Note: If waiting for Invisibility, a Stale Element will be treated as Invisible.
_visible
- True if we are waiting for Web Element to be visible, or false if we are waiting for Web Element to be invisible.org.openqa.selenium.TimeoutException
- If this Web Element's Visibility does not change in the given amount of time.public void waitForVisibility(java.time.Duration _waitTime)
_waitTime
- How long to wait.java.lang.IllegalArgumentException
- If the given Wait Time is negative.org.openqa.selenium.TimeoutException
- If this Web Element's Visibility does not change in the given amount of time.public void waitForVisibility(boolean _visible, java.time.Duration _waitTime)
Note: If waiting for Invisibility, a Stale Element will be treated as Invisible.
_visible
- True if we are waiting for Web Element to be visible, or false if we are waiting for Web Element to be invisible._waitTime
- How long to wait.java.lang.IllegalArgumentException
- If the given Wait Time is negative.org.openqa.selenium.TimeoutException
- If this Web Element's Visibility does not change in the given amount of time.