Import Web Locators

Hello, is it possible to import Web Locators in a text file or excel & import? I was trying to see if I could create a file with the Xpath, Alias, etc in a text file, as an alterative to creating them via the Subject7 UI. Wondering if this is possible and what is the format?



1 comment
Joseph Hamdan

Hi Lance,

At the moment, there is no feature to upload web locators, but there are some alternative solutions to get your work done faster:

1. Inline XPaths: instead of creating a web locator, you can select XPath option from most common commands like Click, Fill, etc where you can just paste the XPath in the step. One thing you should be aware of is that if your application undergoes changes in the future and you have to update the XPath, using web locators is a better option because it allows you to use the same web locator in several tests. When you update a single locator, it takes effect in all of your test cases, but Inline XPaths will require you to perform changes in all steps in all test cases.

2. XPath Templates: Instead of uploading a lot of XPaths that are mostly similar with the exception of the keyword, you can create an XPath template where the keyword is replaced with $LABEL. Silent recorder will then grab the text from your web app and try the available XPath templates. If one works, it will automatically use it and add it to your step, if not then an absolute XPath will be used. So if you can provide as many XPath Templates to avoid absolute XPaths, the chances of the XPath breaking are lower.

Here are some articles on the topics above:

Please let us know if this answers your question or if you have any additional help.

Subject7 Team

Comment actions Permalink

Please sign in to leave a comment.