Hi All,
I have a table with a large number of rows.
how can I make a focus on a row (which is not shown in the screen) before I make a click on this row?
I tried using focus(), but it did not work.
Thank you in advance for your support.
Regards,
Ahmad
Focus on a row fail
Re: Focus on a row fail
Hi,
Could you please post a Ranorex snapshot (NOT screenshot) of the table in question? Unfortunately, without, at very least, snapshot, there is not much anyone here can do or suggest. The obvious thing, you may try, is EnsureVisible action. If EnsureVisible does not help, then you may eventually need to scroll the table, using table's scroll bar, which may require some code. But without seeing your table (its snapshot), these hints are just wild guesses
Could you please post a Ranorex snapshot (NOT screenshot) of the table in question? Unfortunately, without, at very least, snapshot, there is not much anyone here can do or suggest. The obvious thing, you may try, is EnsureVisible action. If EnsureVisible does not help, then you may eventually need to scroll the table, using table's scroll bar, which may require some code. But without seeing your table (its snapshot), these hints are just wild guesses
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
Re: Focus on a row fail
Hi Odklizec,
thank you for your replay.
Here is a snapshot of the table and rows.
I tried focus(), EnsureVisible(), select() but they did not work.
Thank you.
Regards,
Ahmad
thank you for your replay.
Here is a snapshot of the table and rows.
I tried focus(), EnsureVisible(), select() but they did not work.
Thank you.
Regards,
Ahmad
You do not have the required permissions to view the files attached to this post.
Re: Focus on a row fail
Hi,
Thanks for the snapshot. Well, if nothing helps, you will most probably have to use code, which would scroll the table, until the row in question is not visible?
A sample code, doing something similar, can be found here:
https://www.ranorex.com/forum/select-an ... 13961.html
Basically, you must pass a repo element to the method from above post. Here is the xpath you can use for table rows, you want to to make visible...
Where the rowName variable should be filled via variable (e.g. Zeile 67)
Hope this helps?
Thanks for the snapshot. Well, if nothing helps, you will most probably have to use code, which would scroll the table, until the row in question is not visible?
A sample code, doing something similar, can be found here:
https://www.ranorex.com/forum/select-an ... 13961.html
Basically, you must pass a repo element to the method from above post. Here is the xpath you can use for table rows, you want to to make visible...
Code: Select all
/form[@automationid='m_MainWindow']/?/?/grip[@automationid='m_Thumb']/container[@caption='Setup']//table/container[@accessiblename='Datenbereich']/row[@accessiblename=$rowName and @visible='True']
Hope this helps?
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
Re: Focus on a row fail
Hi,
thank you for fast replay .
I think the solution with scroll down method should work. but i have a small question:
how can I pass a repo element info to the method from the xpath?
Thank you.
Regards,
Ahmad
thank you for fast replay .
I think the solution with scroll down method should work. but i have a small question:
how can I pass a repo element info to the method from the xpath?
Thank you.
Regards,
Ahmad
Re: Focus on a row fail
Hi,
You can't create element info from xpath. Element info is a repo-based thing. So you should simply create a repo element with given xpath and then pass that repo element to method. Why do you want to use xpath in code? In my opinion, it's a very bad idea, because this would make your code pretty easy to break and messy. You should always (as much as possible) to pass repo elements to methods.
You can't create element info from xpath. Element info is a repo-based thing. So you should simply create a repo element with given xpath and then pass that repo element to method. Why do you want to use xpath in code? In my opinion, it's a very bad idea, because this would make your code pretty easy to break and messy. You should always (as much as possible) to pass repo elements to methods.
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
Re: Focus on a row fail
Hi,odklizec wrote: ↑Tue May 28, 2019 1:42 pmHi,
You can't create element info from xpath. Element info is a repo-based thing. So you should simply create a repo element with given xpath and then pass that repo element to method. Why do you want to use xpath in code? In my opinion, it's a very bad idea, because this would make your code pretty easy to break and messy. You should always (as much as possible) to pass repo elements to methods.
thank you very much,
I don't want to use xpath in code, I thought first I must use it.
I tried the solution and it works well.
Thank you again very much.
Regards,
Ahmad
Re: Focus on a row fail
Cool! I'm glad it helped
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