Performance in reading text from attributes

Hi … it takes 34 seconds to read text of 20 attributes on one page, and 5 seconds to read the same data on another page. What could be the reason? Is there a faster way to read data on the first page ?

${get_text} Get Text //div[@class=‘abc’][1]//div[@class=‘def’]//div[@class=‘some-value’]

Hi @natK,

I doubt anyone will be able to help you unless you give some detail, here are some questions that might lead you to an answer or at least help someone else help you:

  • are both pages accessable online so we can see the difference?
  • how are you reading the values on the fist page, what are you doing differently on the second page?
  • what is the differences in the html / js / css between the 2 pages?
  • which library (libraries?) are you using to read the pages?

Dave.

1 Like
  1. the pages are not available on the web …
  2. page 1 is more nested than page 2 …
  3. I use the standard Get Text Robot Framework library

I tried to use a more detail xpath by adding extra node but it doesn’t improve searching time //123//456//div[@class=‘abc’][1]//div[@class='def ']// div[@class=‘some value’]

as my last step, i copied full xpath into code, but it doesn’t help

Hi @natK ,

Get Text is not a standard keyword for Robot Framework, so it belongs to a library, since you are talking about web pages and xpath’s I will guess you are using SeleniumLibrary? Can you confirm this? while on this topic can you confirm which browser you are using and if it’s the same browser for both pages?

This is likely a clue to your issue, can you give some detail about the depth of the nesting of the elements in each page, basically to find a solution we probably will need to find a way to reproduce the issue first. Ideally if you can provide the html of the two pages and which elements you are trying to query then we could try and reproduce the issue.

Note also, that the issue may not be with robot framework or even SeleniumLibrary, it may be higher up like selenium itself or even the browser

I did some searching for known issues of xpaths being slow in Selenium, all I really found was this selenium script runs slow ie browser compared browsers like chrome firefox

I’d like to help, but I need some idea where to start.

Dave.

hi Dave,

i am using SeleniumLibrary Chrome
Today i try to use SCC on page 1 and still the same result.

Here is HTML hierarchy on the teste page

page2 … take 5 sec to get txt

> <html>
> <head>
> <body>
<div id='root'...<div>
<div>..<div> event
<div>..<div> event
<div>..<div> event
<div>..<div> event
.. 14 ..
<div> event
	<div class..>..<div>
		<div class..>..<div>
			<div class..>..<div>
				<div class..>..<div>
					<div class..>..<div>
						<div class='target'>..<div>
							<div class='enry'>..<div>
							<div class='value'>..<div>
						<div/>

page1 … takes 35 sec to get test

<div id='root'>..<div>
	<div class = 'app'>
		<div class='app1'>
		<div id>
			<selection class>
				<div class>
					<div class>
						<div class>
							<div class>
								<div class>
									<div class>
										<div class>
											<div class>
												<div class='target'>..<div>
													<div class='enry'>..<div>
													<div class='value'>..<div>
												<div/>
  1. i found that next keyword execution takes delay in the execution to 15-18 sec '${check_element} Run Keyword And Return Status Element Should Be Visible locator ’
  2. next combination gave even longer execution time - 18 sec
    ‘${check_element}= Run Keyword and Return Status Wait Until Page Contains Element locator 3s’
  3. next keyword crush execution when locator wasn’t found
    ‘${timer1WayPage} Wait Until Keyword Succeeds 3 sec 1 sec Element Should Be Visible locator’

Any idea what keyword can give shortest time ?