Css3selector and css3xpath not working


On a webapp that I am trying to automate css3selector and css3xpath are both not working! How do I need to code the following xpath (generated in Chrome) to work with IE and Automation Studio.


You can try using Manual selector in the “Find By” instead of the CSS selectors. It helps creating a selector based on control attributes.


I know I can use the manul find by option but my question is how do I code the xpath that I gave in my original post.



You can simply paste the copied css selector.



The Value that appears if I select the css3selector option is:

:nth-child(3) > :nth-child(2) > :nth-child(1)



The same is generated by default. If during run time system is not able to find the control using same then try using css selector which works for you by replacing the default value.



In order to replace the default value I need to know what the syntax rules are, or more explicilty how to encode the xpath //*[@id=“LDAPResults”]/form/table/tbody/tr[3]/td[2]/table/tbody/tr[1]/td[2]/span as a css3selector or css3xpath



No encoding is required. You can simply put as is



I have tried to use the xpath string as is with find by set to css3selector, css3xpath and manual all three fail with error message “Value does not fall within the expected range.”


Are you trying to select a value from dropdown ?


Hi Amit,

No it is a set of “plain” text fields that I am trying to get the values for. Attached is an image of the inspect element of the field that I gave the example xpath value for.

I know that the details are available on the web page because; it is possible to get the full block of personal details that I am trying to retrieve from the web page using “td > table”,
but then I can’t handle the individual fields that are part of the personal details.



Is this web application publicly available so that i can have a look on the same



No it’s an intranet application (of the client that I work for).


Are you able to get that text field web element using Java Script. AS a workaround, then you can use a java script executor block to fetch the value


I had tried to use an "Execute JavaScript block with the following Java script that I got from a colleague; but it too fails to return a value.

var path= “//*[@id=“LDAPResults”]/form/table/tbody/tr[3]/td[2]/table/tbody/tr[1]/td[2]/span”;
return (document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue).innerHTML



Press F12 and open browser console


see how many HTML element you get. Check the index of your desired web element
document.getElementsByClassName(‘WhoDataClass’)[index of desired element].innerHTML should give the text


Hi Amit,

I tried your document.getElementsByClassName code from the browser console but got an Invalid Character error.

After correcting this to use double quotes I got a different error (see image).

This got me thinking about the path string that I had pasted into in the java code that I got from my colleague so I tried that again after using a backslash to escape the double quotes
in the string. Whilst testing this I notice in the AssistEdge log files the following error:

errormessage~SyntaxError: ‘return’ statement outside of function

Working with the browser console I eventually managed to work out that the document.evaluate method is also not available.

With lots of trial and error I eventually managed to find a document statement that does return the desired value:


But this is still not returning that value to the Parameter used in the Execute JavaScript block.



What is the browser version that you are using

Also, when you are expecting a value to return un JS executor block add return at start of JS code.