Hi Team,
As I have passing the value CreationDate(Integer Value say-8) from excel to my recording.
Code: .//div[#'ui-datepicker-div']//table/tbody/tr/td/?/?/a[@innertext=$CreationDate].
It is not taking the value from excel. And when I statically putting
.//div[#'ui-datepicker-div']//table/tbody/tr/td/?/?/a[@innertext='8'] it is taking the proper value.
Please help me in providing values through variables.
Variables value is not taking
Re: Variables value is not taking
Hi,
If you want to pass a module variable to xpath in user code, you must do it like this:
BTW, using xpaths directly in code will make your test suite unreadable and very hard to maintain! You should always pass the UI elements to code via repository and repoiteminfo/adapter parameters.
If you want to pass a module variable to xpath in user code, you must do it like this:
Code: Select all
.//div[#'ui-datepicker-div']//table/tbody/tr/td/?/?/a[@innertext='" + CreationDate +"'"]
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 8
- Joined: Tue Feb 19, 2019 7:44 am
Re: Variables value is not taking
I am not passing the module variable to xpath in user code.
And where is the variable key in this xpath which you have given.
This is not working
And where is the variable key in this xpath which you have given.
This is not working
Re: Variables value is not taking
Hi,
Well, your initial post indicated, that you are trying to pass a variable to xpath in code? If you simply trying to pass a variable (filled from excel) to the repository xpath, then you must have the variable binded to the proper data connector. Unfortunately, it's impossible to tell what's wrong, without seeing the test suite. Can you share it? My guess is that the variable is either not connected with data connector or connected to wrong data connector or parameter?
Well, your initial post indicated, that you are trying to pass a variable to xpath in code? If you simply trying to pass a variable (filled from excel) to the repository xpath, then you must have the variable binded to the proper data connector. Unfortunately, it's impossible to tell what's wrong, without seeing the test suite. Can you share it? My guess is that the variable is either not connected with data connector or connected to wrong data connector or parameter?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration