waitForText is not working to locate text but waitUntil works - karate

I am getting ready to pull my hair out. Not sure what I am doing wrong but here is the issue:
I have a textbox for which I am verifying an error message for. The html looks something like this:
<span class="text-field-error" data-valmsg-for="Name" data-valmsg-replace="true"><span id="Name-error" class="">There are invalid characters being used.</span></span>
My xpath to locate the error message looks something like this:
//span[#id='Name-error']
I am using the following command to verify the error message:
driver.waitForText('//span[#id='Name-error']','There are invalid characters being used.')
This verification fails.
However, when I try the following command, it works fine.
driver.waitUntil('//span[#id='Name-error']',"_.innerText.includes('There are invalid characters being used.')")
I have verified there is no hidden whitespace in the first instance. I have to use waitForText vs waitUntil to keep up with coding standards within my project.
Please advise, Peter.

I have no idea, maybe it is a bug. If you can provide a way to replicate, that will help the community: https://github.com/karatelabs/karate/tree/develop/examples/ui-test
Meanwhile see if this works:
waitForText('body', 'There are invalid characters being used')
I can't help noticing that you are not using double-quotes when needed.
waitForText("//span[#id='Name-error']", 'There are invalid characters being used')

Related

Illegal character in query when doing a conditional GET with multiple parameters

While using Karate DSL version 0.9.2, I can send a conditional get with multiple parameters with no problem.
Something like 'Given path 'get?condition=payment_plan='B' and equal_paymnt_flg='D''', will work perfectly fine.
However on version 1.0.1 the same will produce an error, Illegal character in query at index 84, and the call will fail.
Any ideas why?
Please try 1.1.0.RC4 and if there is still a problem it can be a bug we need to fix.
More details here: https://github.com/intuit/karate/issues/1561

Drone segment in URL cannot contain colon

I got the below error while setting up Drone CI.
myid:bin domain$ drone info parse
“http://drone5.internal.com/”/api/user: first path segment in URL
cannot contain colon
I searched online for answer but didnt get the right one.
Finally I found that it was due to the URL syntax I am getting the error.
while setting up the variables dont use double quotes.
export DRONE_SERVER="https://drone5.internal.com" is wrong.
But
export DRONE_SERVER=https://drone5.internal.com will work perfectly

j8583 How to get debugString after parseMessage

When I get the debugString() of an IsoMessage that I build, it works fine, but when I try to get the debugString() of an IsoMessage that was created by parsing (mf.parseMessage(..)) the debugString() is empty.
The parsing works fine, and the field values are there, but the debugString() returns empty string.
Am I missing something?
Isn't it possible to print the debugString of a parsedMessage?
Any message should be able to print its debugString. This must be a bug.
UPDATE so this is weird, because I just added a simple test to check for this, and it passes:
https://github.com/chochos/j8583/commit/3a32b9041470c31a451791f3baa082f18204504a
The problem seems to be Eclipse's console.
The debugString starts with a non printable character which seems to cause the problem.
When run standalone, the debugString gets printed ok like this:
^#p023060180...
(Notice the ^#p at the begining).

Like Box - Blogger Error

I'm tring to put facebook Like Box to my blog but after I put Javascript SDK (right after opening body it show me error
**
The reference to entity "appId" must end with the ';' delimiter.
**
and I cant fix it ... :(
What I need to do/edit ???
I had the same problem: fbml=1 appId where I just deleted & and put the closing script right after Load the SDK line. I checked it with the debugger and now there are no errors.
I'm not asking for other permissions, just the "like my page."
{edit. had to change to closing script as the brackets and script didn't show.
Yes, Change the &appId to &appId ant it will work.

Why escaping quote doesn't work with my webservice?

I access to my webservice like that:
http://localhost/SuiPService/SuiPDataService.svc/GetShowCodeFiltered?&showName='auto'
It works fine, but when I try:
http://localhost/SuiPService/SuiPDataService.svc/GetShowCodeFiltered?&showName='auto''
it failed, ok this I understand, but if I encode the url like that:
http://localhost/SuiPService/SuiPDataService.svc/GetShowCodeFiltered?&showName='auto%27'
I get the error Bad Request - Error in query syntax. too
What is the solution?
The reason it's failing is because %27 is equal to '.
Everything is encoded before being sent to the web server, even if the URL box doesn't say so.
This will become hard to maintain and possibly confuse your users. I'd change it so you aren't padding the variable with ' and that way you can use http://localhost/SuiPService/SuiPDataService.svc/GetShowCodeFiltered?&showName=auto' if you need to have a ' after it.
Also, if you need the '' around auto. Consider doing this on the server side.
It looks like your using this to build an SQL query...
See here for the reason PHP deprecated it for that exact reason: http://en.wikipedia.org/wiki/Magic_quotes
Hope this helps,
Jeffrey Kevin Pry