Posts

Showing posts from November, 2019

How to Stop Selenium browser popup "Failed to load extension from : c:/users/internal. Loading of unpacked extensions is disabled by the administrator".

Image
How to Stop Selenium browser popup "Failed to load extension from : c:/users/internal. Loading of unpacked extensions is disabled by the administrator". You can stop this by creating webdriver with special properties. Example: ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.setExperimentalOption("useAutomationExtension", false);

How to handle browser admin login popup in selenium?

Image
How to enter username and password to this browser login popup? Solution: You can send username and password in the URL request. Example:  htpp://username:password@xyz.com But in the latest web browser url credentials are blocked because of security issues. Still you can use that features, you have to create web driver with some special operations. Example: ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.addArguments("--disable-blink-features=BlockCredentialedSubresources"); This feature consider as network error. You can reopen the URL. Example: driver.get(" htpp://username:password@xyz.com"); driver.get("xyz.com");

Java - Annotations for Concurrency

Class Annotations We use three class-level annotations to describe a class's intended thread- safety promises: @Immutable, @ThreadSafe, and @NotThreadSafe. @Immutable means, of course, that the class is immutable, and implies @ThreadSafe. @NotThreadSafe is optionalif a class is not annotated as thread-safe, it should be presumed not to be thread-safe, but if you want to make it extra clear, use @NotThreadSafe. These annotations are relatively unintrusive and are beneficial to both users and maintainers. Users can see immediately whether a class is thread-safe, and maintainers can see immediately whether thread-safety guarantees must be preserved. Annotations are also useful to a third constituency: tools. Static codeanalysis tools may be able to verify that the code complies with the contract indicated by the annotation, such as verifying that a class annotated with @Immutable actually is immutable. Field and Method Annotations The class-level annotations above ar...

Elasticsearch - Indices

Indices are containers for mapping types. An Elasticsearch index is an independent chunk of documents, much like a database is in the relational world: each index is stored on the disk in the same set of files; it stores all the fields from all the mapping types in there, and it has its own settings. For example, each index has a setting called refresh_interval, which defines the interval at which newly indexed documents are made available for searches. This refresh operation is quite expensive in terms of per- formance, and this is why it’s done occasionally—by default, every second—instead of doing it after each indexed document. If you’ve read that Elasticsearch is near-real-time, this refresh process is what it refers to. TIP Just as you can search across types, you can search across indices. This gives you flexibility in the way you can organize documents. For example, you can put your get-together events and the blog posts about them in different indices or in differ...

Elasticsearch - Types

Types are logical containers for documents, similar to how tables are containers for rows. You’d put documents with different structures (schemas) in different types. For example, you could have a type that defines get-together groups and another type for the events when people gather.  The definition of fields in each type is called a mapping. For example, name would be mapped as a string, but the geolocation field under location would be mapped as a special geo_point type. (We explore working with geospatial data in appendix A.) Each kind of field is handled differently. For example, you search for a word in the name field and you search for groups by location to find those that are located near where you live. TIP Whenever you search in a field that isn’t at the root of your JSON docu- ment, you must specify its path. For example, the geolocation field under location is referred to as location.geolocation. You may ask yourself: if Elasticsearch is schema-free, why ...

Elasticsearch - Documents

Elasticsearch is document-oriented, meaning the smallest unit of data you index or search for is a document. A document has a few important prop- erties in Elasticsearch: ■ It’s self-contained. A document contains both the fields (name) and their values (Elasticsearch Denver). ■ It can be hierarchical. Think of this as documents within documents. A value of a field can be simple, like the value of the location field can be a string. It can also contain other fields and values. For example, the location field might contain both a city and a street address within it. ■ It has a flexible structure. Your documents don’t depend on a predefined schema. For example, not all events need description values, so that field can be omitted altogether. But it might require new fields, such as the latitude and longitude of the location. A document is normally a JSON representation of your data. As we discussed in chap- ter 1, JSON over HTTP is the most widely used way to communicate wi...