The save.txt file is NOT a valid HTML. Apparently you edited the original; to make it short, to make it readable for me. Consequently the file is turned to be invalid HTML format, which is unable for any tools to parse correctly.
You can put the whole HTML into zip archive, which will be small enough to attache to the forum page.
Do you mean, there is some portions in your target HTML which changes dynamically (changes every time you requested the URL)? If so which portions? Please identify and describe it (hopefully you can write a xpath expression which identifies the dynamic portion).
We’ve improved the performance of Katalon Studio to handle SVG elements better in version 7.1. Please upgrade when the new version’s available and let me know it you still encounter this issue.
I tried to write the xpath as below :
//div[@ id=“container”]/div/[local-name()=“svg”]/ [local-name()=“g” and @class=“highcharts-axis-labels highcharts-xaxis-labels ”]/[local-name()=“text” and @x=“303”]/[local-name()=“tspan”]
But it is unable to find the text.
Any suggestions would be of great help.
Thanks in advance.
//div[@id="container"]/div/*[local-name()="svg"]
/*[local-name()="g" and
contains(@class, "highcharts-axis-labels") and
contains(@class, "highcharts-xaxis-labels")]
/*[local-name()="text" and @x="303"]
/*[local-name()="tspan"]
I can not find the immediate answer (successful XPath expression) because you haven’t informed us of the URL of your Application Under Test. You have to try more to find appropriate XPath expression for yourself.
How to find a XPath which selects the text you want? — Try top-down/step-by-step approach:
verify if //div[@id="container"] can select the nodes in the Web page (DOM).
if it works, then modify the XPath to be a bit more specific. Verify //div[@id="container"]/div
if it works, then verify //div[@id="container"]/div/*[local-name()="svg"]
if it works, then verify //div[@id="container"]/div/*[local-name()="svg"]/*[local-name()="g"]
if it works, then verify //div[@id="container"]/div/*[local-name()="svg"]/*[local-name()="g" and contains(@class, "highcharts-axis-labels")]
if it works, then verify //div[@id="container"]/div/*[local-name()="svg"]/*[local-name()="g" and contains(@class, "highcharts-axis-labels") and contains(@class, "highcharts-xaxis-labels")]
if it works, then verify //div[@id="container"]/div/*[local-name()="svg"]/*[local-name()="g" and contains(@class, "highcharts-axis-labels") and contains(@class, "highcharts-xaxis-labels")]/*[local-name()="text"]
if it works, then veirfy //div[@id="container"]/div/*[local-name()="svg"]/*[local-name()="g" and contains(@class, "highcharts-axis-labels") and contains(@class, "highcharts-xaxis-labels")]/*[local-name()="text" and @x="303"]
if it works, then verify //div[@id="container"]/div/*[local-name()="svg"]/*[local-name()="g" and contains(@class, "highcharts-axis-labels") and contains(@class, "highcharts-xaxis-labels")]/*[local-name()="text" and @x="303"]/*[local-name()="tspan"]
At some point, your xpath will fail to select any node. That is the point where your XPath falls short. Look at it more carefully, find reasons and fix them.
Katalon Studio is not very good tool to perform such step-by-step verifications of XPath. I would rather suggest to you to use Google Chrome’s Developer tools to verify xpaths. See
It works in Chrome but fails in Mozilla where the value is x=303.
Is there a way to handle this ? As I will need all the text values for verification of my test case.
Then, your XPath should not look at the @x attribute.
You should find alternative way of identifying the <tspan>...</tspan> node of your interest somehow.
What kind of “alternative way” is possible?
For exampe,
//div[@id="container"]/div/*[local-name()="svg"]
/*[local-name()="g" and
contains(@class, "highcharts-axis-labels") and
contains(@class, "highcharts-xaxis-labels")]
/*[local-name()="text"]
/*[local-name()="tspan" and .="Nov 01"]
This expression would work, but I suppose it would not be satisfactory for you.
What else? … difficult. I think your HTML is not designed E2E testing in mind at all.
Let me assume you can ask your Web developer to modify the server-side application to generate a HTML code with the following fragment: