Aug-12-2018, 05:38 AM
Very new to Robot Framework and am trying to read the elements from xpath / css
My Code
My variable declaration
${xpath_l} xpath=//*[@class='ant-layout-sider-children']/ul/li
${css_1} css:div.ant-lyout-sider > div.ant-layout-sider-children li
*** Test Cases ***
${items1}= Get WebElement ${xpath_1}
Problem
and when i execute this test file robot <testfile>.robot, I get Element with locator not found
When I open the Inspect, the text path is highlighted correctly.
I need to view all the menu items under this path.
How to view this and constantly getting this locator error.
<ul class="ant-menu ant-menu-white ant-menu-inline-collapsed ant-menu-root ant-menu-vertical" role="menu" style="height: 100%;">
<li class="ant-menu-item" role="menuitem"><i class="anticon mk-ciRdSV mtKCPE" href="normal" src="view"><svg></svg></i><span>View</span></li>
<li class="ant-menu-item ant-menu-item-selected" role="menuitem"><i class="anticon mk-ciRdSV mtKCPE" href="selected" src="Settings"><svg>
...
and there are 7 more items.
How do I fix this?
Thanks
My Code
My variable declaration
${xpath_l} xpath=//*[@class='ant-layout-sider-children']/ul/li
${css_1} css:div.ant-lyout-sider > div.ant-layout-sider-children li
*** Test Cases ***
${items1}= Get WebElement ${xpath_1}
Problem
and when i execute this test file robot <testfile>.robot, I get Element with locator not found
When I open the Inspect, the text path is highlighted correctly.
I need to view all the menu items under this path.
How to view this and constantly getting this locator error.
<ul class="ant-menu ant-menu-white ant-menu-inline-collapsed ant-menu-root ant-menu-vertical" role="menu" style="height: 100%;">
<li class="ant-menu-item" role="menuitem"><i class="anticon mk-ciRdSV mtKCPE" href="normal" src="view"><svg></svg></i><span>View</span></li>
<li class="ant-menu-item ant-menu-item-selected" role="menuitem"><i class="anticon mk-ciRdSV mtKCPE" href="selected" src="Settings"><svg>
...
and there are 7 more items.
How do I fix this?
Thanks