Closed dannydong closed 8 years ago
Hello
It is clearly possible to generate a locator in a format
return '//' + elementTagName + '[@id="' + element.id + '"]';
rather than
return 'id("' + element.id + '")';
(with possible variations like the one you provided) - the result is simply a string. Isn't the usage of absolute XPaths discouraged in general ?
Hi @dannydong,
I have created a patch that might provide a hotfix for this case.
SwdPageRecorder_v2...\JavaScript\
ElementSearch.js
to Backup_ElementSearch.js
ElementSearch.js
to the folder SwdPageRecorder_v2...\JavaScript\
PATCH ATTACHMENT ElementSearch.zip
Thank a lot @dzharii and @sergueik, I have done a quick test with the patch, it does work! Very helpful, appreciate with your help. Great!
I will close the issue since it was resolved
@dannydong I am glad it has helped you!
Dear authors,
This is a great application for web automation, but I am experiencing a problem during my work with it. The swd-recorder captures the xpath which is something like (in the output pox file):
However, the id of "svep_19_i0_508" always changes because of the id is generated dynamically by the Web server, so when I re-open the page, I always fail to find the page element recorded.
What I expect is something similar with :"html/body/section/section/x1-workspaces/div/div[2]/x1-tabset/ul/li[7]/a
A work-round is to use the firepath to get the absolute xpath, so I hope the swd-recorder can extract the absolute xpath of page elements, probably it can re-use the interface of firepath or firebug?
Very appreciate with your help.