I am doing my first POC with Browser library so I am not sure whether I am doing everything correctly (if what I am doing is supported), so want to double check before submitting issue.
When I am using Get Text keyword with SVG element (obtained using Get Element keyword) I am getting error:
local variable 'value' referenced before assignment
Minimal Example:
*** Settings ***
Library Browser timeout=30
*** Test Cases ***
Demo SVG - Fails
New Browser firefox headless=${False}
New Page https://www.highcharts.com/demo/responsive
${parents} Get Elements //*[local-name()="g" and contains(@class, "highcharts-legend-item")]
FOR ${element} IN @{parents}
${rect_el} Get Element ${element} >> xpath=./*[local-name()="rect"]
${fill} Get Attribute ${rect_el} fill
${text_el} Get Element ${element} >> xpath=./*[local-name()="text"]
${text} Get Text ${text_el}
END
I think you cannot declare a variable inside a loop in RF.
In RF you should use Collections library
First you “create list” then inside of a loop you will “append to list”
But I am not sure what are you trying to accomplish with that test Please provide a little context so I can be more specific.
And CSS selectors enable a bit clearer selector :).
${parents} = Get Elements g.highcharts-legend-item
Investigating issue more and found more problems to be fixed. Therefore this is not fixed in the 4.5.0. The 4.5.0 contains only updated Playwright 1.11.0. Will be part of the 4.6.0 release.