Robot framework is not able to fetch the locator, i tried copying the xpath ,still i am getting this "unable to find the locator" error

39 views Asked by At

This is the elements

I am trying to automate an application using Robot framework , selenium in PyCharm tool.

I tried keyword definition to click on the side bar entity called "GCC Intelligence", I am getting below error:

Element with locator '/html/body/div[1]/aside/section/ul/li[3]/a' not found.
1

There are 1 answers

0
Shawn On

Absolute XPath expressions are not reliable. Try to use relative XPaths instead.

Change your XPath expression to:

//a[@href='/gvv-intelligence-platform']

Or this:

//span[text()='GCC Intelligence']

Refer this answer to know more about absolute and relative XPaths