I am trying to test a sample scenario involving use of variables in XPath.
There is a test suite library and a test solution. The library contains Login and Logout modules whereas the test solution contains Search module
I used a variable in the Base Xpath as the domain attribute pointed to my application and the requirement was to be able to run the tests on different URLs running the same application.
The Base XPath looks like this
Code: Select all
/dom[@domain=$domain]
In the Test solution, I again use a variable in the Xpath for the Domain attribute for the same reason as mentioned above. I use the same variable name so the base path again looks like this
Code: Select all
/dom[@domain=$domain]
Now I add this test library into the test solution as a reference. The test case I create has the following steps
- Login (from the test library)
Search (from the test solution)
Logout (from the test library)
Code: Select all
Failed to find item 'SharedRepoRepository.Login.JUsername'.
No element found for path '/dom[@domain='http://<mydomain>']//input[#'j_username']' within 1m