Web-GUI: x-path

i want to use dynamic x-path in my example but at the time of create dynamic x-path using javascript it gives error
Unable to get fields from previous steps because of an error
missing ; before statement (script#3)
because of this I’m not able to set dymanic x-path variable in javascript

Hi @digwijay1996,

You need to escape the double quotes (") before and after the id value i.e. homefeatured. Please try this and get back. If this does not work, you can also send the screenshot of your workflow.

yes i remove this but after that how can i get this fiels to set dynamic

In modified java script, click on Get Variables. You will get the path entry in the bottom table. Type string will automatically populated. If not, select it from dropdown under type. Then last column, select N from dropdown. Post this, you will be able to see your path entry in the drop down. Let me know if this works.

its working sir thank you for help

1 Like

sir it gives error can not find x-path

Add a delay, that should help you. Internet connection speed and page load time often take longer than what it takes the bot to read a page. Add a few seconds delay. You can start with 3 seconds and check if it works.
Another reason maybe your xPath may not be correct. Cross verify that from the spy. Put in the xPath in locate element and check if your element is getting highlighted.

badges