I am trying to automate a scenario, where i need to enter card details like name on card, card number, expiry date and CVC number. When i am trying to send the expiry date say as "2318", by default it is accepting value as "23/8". Ideally it should accept value as "23/18". I tried to give space in month and year but still it's not working. Any idea how to automate this?
following is my piece of code :
#Override
public void enterCardDetails() {
waitForElement(appiumDriver,enterNameOnCardEditField).sendKeys("test");
waitForElement(appiumDriver,enterCardNumberEditField).sendKeys("0000000000000000");
waitForElement(appiumDriver,enterExpiryMMYYEditField).sendKeys("2518");
waitForElement(appiumDriver,enterCVCNumberField).sendKeys("000");
waitForElement(appiumDriver,makePaymentOption).click();
}
I am using following appium and selenium versions :
appium-java client : 6.0.0-BETA5
appium Desktop version : 1.6.1
Selenium java version : 3.9.1
Unfortunately, I can not provide any screenshot of the appium inspector.
As per your question what you are seeing is pretty much expected and is a result of validation error on the field for expiry date.
Essentially, the expiry date on any Credit Card would consist of MM/YY format, where:
MM field would accept character sequence e.g. 01, 10, 12, etc
YY field would accept character sequence e.g. 18, 19, 20, etc
Now whenever you try to send the character sequence of 2318 the js involved for the validation doesn't accepts the characters and in absence of a proper js validator allows the characters 23 and 8 within the MM and YY fields respectively.
It's a pottential bug which may have escaped Manual Validation
Solution
Send a valid character sequence as follows:
waitForElement(appiumDriver,enterExpiryMMYYEditField).sendKeys("0718");
I was able to solve this issue by adding following capability :
capabilities.setCapability("maxTypingFrequency",10);
Related
My Data in a json looks like -
{"text": "\"I have recently taken out a 12 month mobile phone contract with Virgin but despite two calls to customer help I still am getting a message on my phone indicating \\\"No Service\\\" although intermittently I do get connected.\"", "created_at": "\"2018-08-27 16:58:30\"", "service_id": "51870", "category_id": "249"}
I read this JSON Using -
val complaintsSourceRaw = spark.read.json("file:///complaints.jsonl")
When i read the data in dataframe, it looks like
|249 |"2018-08-27 16:58:30"|51870 |"I have recently taken out a 12 month mobile phone contract with Virgin but despite two calls to customer help I still am getting a message on my phone indicating **\"No Service\"** although intermittently I do get connected."
Issue is
**\"No Service\"** need to be like **"No Service"**
How i am trying -
complaintsSourceRaw.withColumn("text_cleaned", functions.regexp_replace(complaintsSourceRaw.col("text"), "\", ""));
However \ character excapes my " and code breaks. Any idea how to acieve this?
You need to escape the "\" character, so in your regexp_replace you should look for two backslash ("\\") characters, not one.
I'm implementing quite a complex search using MarkLogic Java API. I would like to enable relevance-trace (Relavance trace) to see how my results are scored. Unfortunately, I don't know how to enable it in Java API. I have tried something like:
DatabaseClient client = initClient();
var qmo = client.newServerConfigManager().newQueryOptionsManager();
var searchOptions = "<search:options xmlns=\"http://marklogic.com/appservices/search\">\n"
+ " <search-option>relevance-trace</search-option>\n"
+ " </search:options>";
qmo.writeOptions("searchOptions", new StringHandle(searchOptions).withFormat(Format.XML));
QueryManager qm = client.newQueryManager();
StructuredQueryBuilder qb = qm.newStructuredQueryBuilder("searchOptions");
// query definition
qm.search(query, new SearchHandle())
Unfortunately it ends up with following error:
"Local message: /config/query write failed: Internal Server Error. Server Message: XDMP-DOCNONSBIND:
xdmp:get-request-body(\"xml\") -- No namespace binding for prefix search at line 1 . See the
MarkLogic server error log for further detail."
My question is how to use search options in MarkLogic API, especially I'm interested in relevance-trace and simple-score
Update 1
As suggested by #Jamess Kerr I have change my options to
var searchOptions = "<options xmlns=\"http://marklogic.com/appservices/search\">\n"
+ " <search-option>relevance-trace</search-option>\n"
+ " </options>";
but unfortunately, it still doesn't work. After that change I get error:
Local message: /config/query write failed: Internal Server Error. Server Message: XDMP-UPDATEFUNCTIONFROMQUERY: xdmp:apply(function() as item()*) -- Cannot apply an update function from a query . See the MarkLogic server error log for further detail.
Your search options XML uses the search: namespace prefix but you don't define that prefix. Since you are setting the default namespace, just drop the search: prefix from the search:options open and close tags.
The original Java Query contains both syntactical and semantic issues:
First of all, it is an invalid MarkLogic XQuery in the sense that it has only query option(s) portion. Bypassing the namespace binding prefix is another wrong end of the stick.
To tweak your original query, please replace a search text in between the search:qtext tag ( the pink line ) and run the query.
Result:
Matched and Listing 2 documents:
Matched 1 locations in /medals/coin_1333113127296.xml with 94720 score:
73. …pulsating maple leaf coin another world-first, the [Royal Canadian Mint]is proud to launch a numismatic breakthrough from its ambitious and creative R&D team...
Matched 1 locations in /medals/coin_1333078361643.xml with 94720 score:
71. ...the [Royal Canadian Mint]and Royal Australian Mint have put an end to the dispute relating to the circulation coin colouring process...
Without a semantic criterion, to put it into context, your original query will be an equivalent of removing the search:qtext and performing a fuzzy search.
Note:
If you use serialised term search or search constraints instead of text search, you should get higher score results.
MarkLogic Java API operates in unfiltered mode by default, while the cts:search operates in filtered mode by default. Just be mindful of how you construct the query and the expected score in Java API.
And it is really intended for bulk data write/extract/transformation. qconsole is, in my opinion, more befitting to tune specific query and gather search score, relevance and computation details.
I'm using WhoisClient (org.apache.commons.net.whois.WhoisClient) to retrieve my website domain expiry date. It is working for the domain with .com extension. When I try to check the expiry date for one of my .org domain the result says No match for domain.org. How do I find out the expiry date of a .org and .in extension domain?
I'm using the following code for getting the expiry date of the domain
String domainName = mydomain.replaceFirst("^(http[s]?://www\\.|http[s]?://|www\\.)","");
WhoisClient whois = new WhoisClient();
whois.connect(WhoisClient.DEFAULT_HOST);
String whoisData1 = whois.query("=" + domainName);
whois.disconnect();
Do not bother with the whois protocol.
Now (since August 26th, 2019) per ICANN requirements, all gTLDs need to have an RDAP server. RDAP is like the successor of whois: kind of the same content exchanged but this time on top of HTTPS with some fixed JSON format. Hence, trivial to parse.
The expiry date will be in the "events" array with an action called "expiration".
You can go to https://data.iana.org/rdap/dns.json to find out the .ORG RDAP server, it is at URL https://rdap.publicinterestregistry.net/rdap/org/
You need to learn a little more about RDAP to understand how to use it (structure of the query and the reply), you can find some introduction at https://about.rdap.org/
But in short your case, this emulates what you need to do:
$ wget -qO - https://rdap.publicinterestregistry.net/rdap/org/domain/slashdot.org | jq '.events[] | select(.eventAction | contains("expiration")) | .eventDate'
"2019-10-04T04:00:00.000Z"
PS1: if you get no match from a whois query normally it really means that the domain does not exist; it could also be because of rate limiting
PS2: .IN may not have an RDAP server yet, since it is a ccTLD it is not bound by ICANN rules.
I'm going crazy with all possible query syntaxes used on IBM Notes (old Lotus) databases for searching documents.
I just need all documents (i.e. emails) created (or delivered, which seems to be the same) between a given range of dates, using lotus.domino.Database.search(query) method in Java package for IBM Notes. Consider that I already know the dates format in my system ("dd/MM/yyyy").
Which should be the query?
First of all: To find out about the syntax just create a view in Domino Designer or check the views that are there (e.g. in your own mail database) and check the "Selection"- formula. Then remove the "SELECT" statement in front of it and use that as query.
Your query would be quite simple:
Form = "Memo" : "Reply" & #Date(#Created) >= [2018/01/01] & #Date(#Created) <= [2018/05/04]
if you are not sure, which date format your server uses, then just use this query instead:
Form = "Memo" : "Reply" &
#Date(#Created) >= #Date( 2018 ; 1 ; 1 ) &
#Date(#Created) <= #Date( 2018 ; 5 ; 4 )
This is the right formula for all mail- types. If you need alle calendar- type- documents, then use Form = "Appointment" : "Notice".
As a rule of thumb: Just go to the items- tab in the properties of any document you want to return and examine all items in the left hand site. Then simply use the item name in your formula as variable (except Body: That one would need special treatment).
I am new at Sun Java System Messaging Server 6.3. I am managing my e-mail users and group via ldapbrowser version 2.8.2.
I want to exclude a particular user from people group.
I found the below string in people group's configuration:
memberURL: ldap:///o=domain.com,dc=domain,dc=com??sub?(&(Employeenumber=*)(InetUserStatus=active))
The definition of the 'People' group is:
Within ldap:///o=domain.com,dc=domain,dc=com, where the attribute Employeenumber is present (Employeenumber=*), and the attribute InetUserStatus has the value active (InetUserStatus=active).
So, if you want to exclude someone, you need and attribute to match, and the value to exclude and construct the LDAP search filter that matches this, and update the filter (&(Employeenumber=*)(InetUserStatus=active)) to correspond to this.
so, if they were Employeenumber 55, then you don't want them in the list, so the condition for this is !(Employeenumber=55), so you need to plug this into the selection condition as:
(&(&(Employeenumber=*)(InetUserStatus=active))(!(Employeenumber=55)))
If you wanted to filter a second user (e.g. Employeenumber 99 as well, then it becomes:
(&(&(&(Employeenumber=*)(InetUserStatus=active))(!(Employeenumber=55)))(!(Employeenumber=99)))
You can see how this will get very complicated very quickly.