Issue with double quotes

Hello everyone!

I am struggling with one issue and I think that I am gonna find solution here :smiley:
So, what I want to do is the loop through multiple in specific table. Firstly, I have created 2 variables -xpath_1 and xpath_2. First one is the text before index and the second one stands for text after index (pic).

image

Then I have made counter so it simply changes index.

image

And finally by join text I gather all necessary things together, to one string - xpath_all

Problem starts when I want to get web element’s value using xpath from variable. I don’t know why, but it doubles my double quotes and I have no idea why. (pic below)

image

So the first row shows what I see after playing record in csv file and the second one shows what should be the path.

And the question is do you know how to make just one double quotes? :smiley:

Thank you! :slight_smile:

Hi @staszker.
I was able to reproduce your issue. Will clarify whether it’s bug or not.

1 Like

Thank you Valeria :slight_smile:
I am waiting for you then :smiley:

1 Like

I checked once again and what I found. When you created new Xpath value by joining strings the result in .csv file is showing with double quotes. But when I use this variable in notepad, for example, it looks correct.
image
Could you please advise whether you received any exception with composite value if you’re using it further in the script?

Hello Valeryia!

I didn’t receive any exception further in the script. And I found out what is wrong.
My xpaths had doubled (span/span) at the end and that was the reason of error.
However, double quotes in csv for me were misleading and firstly I focused just on them, trying to fix it, instead of checking if my variables are correct.

Thank you for your time :slight_smile:

3 Likes

Thanks :slight_smile: Glad to know that you made it work as expected.
As about double quotes in CSV files, looks like automatic string escape. Please see this article for the details: https://www.freeformatter.com/csv-escape.html.

1 Like