VerifyEqual command giving error

Hi

We have used verify equal command to verify the data appearing between application and Data in excel.

This was working fine earlier but now giving error even the application data and data in excel file is same. not sure why in report 2 single quote is appearing as highlighted in yellow. please let me know why this is happening

see the below screen for the error

please help

Thanks
Deelip

The Actual Object should be what comes from the web page. The Expected Object could be what you have typed into the statement or getting from a second source. Take a look at your “Expected Object” and see if there are two single quotes around it (maybe surrounded by a double quote).

WebUI.verifyEqual(Actual Object, Expected Object)

Hi

thanks for your response

below is the expected data which is coming from excel and there is no double Quotes

image

I had put this single quote when i started getting error but after putting single Quote still the same error

image

That looks like a stray quote to me

May I suggest to just remove all single quotes from the Excel import string:

WebUI.comment(Expected Object)
Expected Object = Expected Object.replace("’", “”);

WebUI.comment(Expected Object)
WebUI.verifyEqual(Actual Object, Expected Object )

Edit:
I just had a thought that you may have to write this as:
Expected Object = Expected Object.toString().replace("’", “”);

Hi

i am getting the below error in console log after implementing your suggestions

below is my script

image

You cannot use “smart” quotes in the KS code. “Smart” quotes have a curl to them. Note the quotes in your image.

To fix the code:
Copy and paste the code to Notepad, (not WordPad or Write) then copy and paste it back to KS. Or retype the quotes in KS.

is the below ok now. after copying from notepad, it was still displaying Smart Quote so i manully changed to double Quotes and give no space between them

Approval_Steps = Approval_Steps.toString().replace("’", “”)

I still see “smart” quotes. You will have to retype all within the parenthesis:

(double quote, single quote, double quote, comma, space, double quote, double quote)

ok and with the below command i should remove Single quote which is in excel as below, right?

image

Approval_Steps = Approval_Steps.toString().replace("’", “”)

In Excel, you will have an implicit single quote of any “function” that does not start with an equal sign. Leave it for now, and see it the replace method works.

Hi

Thanks for your help. The command provided by you resolved the issue but i would need your help to understand why this happened as earlier it was working with the same command. please help to understand the root cause

Earlier it was executed in version - Katalon version: 6.0.6.4 and Chrome - 80 - here it was passing

but now failing in 6.3.3.11 and Chrome 83

Have you done anything to do with the data in Excel, such as copy and paste to another spreadsheet or added any specific cell formatting?

Hi

No, I have not made any data change and format in excel

Thanks
Deelip