Issue with object recognition when using variable XPath
Posted: Thu Dec 05, 2013 3:47 pm
Hi Everyone,
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
When i try to run Login and Logout modules independently, they work just fine.
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
The reason for using the same domain name is because I plan to use an excel sheet to provide values for the variables and as logically both variables point to the same domain, the same cell in the excel sheet can be used.
Now I add this test library into the test solution as a reference. The test case I create has the following steps
Am I missing something? I have been looking for a solution for this for a couple of days but could not find it. Appreciate any help in solving this issue.
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