Hello there,
I am currently writing a web test [Ranorex 9] under chrome to remove a user from a table:
I want to remove a User called 'Dummy User'. To remove the user I need to select him at first step. And here is my little problem:
My repo item for the table only has visible entries in it(like for 1 til Alison). See the attached rxsnp file.
Can you tell how I can reach the entry for 'Dummy user' to select this specific user?
Thanks in advance!
Select an item from scroll able web table
-
- Posts: 8
- Joined: Tue Jun 21, 2016 1:53 pm
- Location: Germany
Select an item from scroll able web table
You do not have the required permissions to view the files attached to this post.
Re: Select an item from scroll able web table
Well there are a few ways to go about this depending on your AUT. If you have coders available on your team, you can loop trying to find the name you are looking for and if it is not found, scroll and search the new names that are now visible. Rinse and repeat until your specified name is found.
If the list is in a fixed order, you could utilize recording modules and IF conditions to test your scenario. So for example if the list is always in the same order and we know it takes 10 scroll actions to reach the name you are looking for, then you can have a specific module which scrolls the correct number of times to the specified name.
So let's say you are looking for the name David and it takes 5 scrolls from the top of the list to make the name David visible. Here is how it would go:
Hope this helps
If the list is in a fixed order, you could utilize recording modules and IF conditions to test your scenario. So for example if the list is always in the same order and we know it takes 10 scroll actions to reach the name you are looking for, then you can have a specific module which scrolls the correct number of times to the specified name.
So let's say you are looking for the name David and it takes 5 scrolls from the top of the list to make the name David visible. Here is how it would go:
- Data source has the value 'David' which is the name you are looking for
- You have a recording module which scrolls exactly 5 times to find the name David, performs the needed actions and then scrolls back to the top of the list. (optional) We want to scroll back to the top so you always start in the same spot if you are doing more searches afterwards
- Then you would place this recording module in a test container (testcase or smart folder) and set an IF condition to only execute the container if the data source value is equal to 'David'
Hope this helps
You do not have the required permissions to view the files attached to this post.
Re: Select an item from scroll able web table
Hi,
I'm dealing with similar lazy-loaded lists/tables, by using 'while' loop and Down or PageDown shortcuts. If Down/PageDown does not work with your table, you will probably have to mouse click the scrollbar? Here is an example of code I'm using in my projects:
That is the 'easy' part Now the real problem is, that the very last item is always outside the visible area of table, yet, the item is marked as visible=true! So in case the dummy item, you are looking for, is at the very last table position, the mouse click may fail to click it. And sadly, EnsureVisible is useless here. So you will most probably have to use Enter shortcut, as I'm using it in my sample. Of course, the pre-requisity is, that the item you want to 'enter' is already selected. Otherwise, Enter shortcut may eventually confirm wrong item.
I'm dealing with similar lazy-loaded lists/tables, by using 'while' loop and Down or PageDown shortcuts. If Down/PageDown does not work with your table, you will probably have to mouse click the scrollbar? Here is an example of code I'm using in my projects:
Code: Select all
public void ScrollToElement(RepoItemInfo repoItemToFind, Adapter listBox)
{
SpanTag foundElement=null;
Keyboard.PrepareFocus(listBox);
Keyboard.Press(System.Windows.Forms.Keys.Home, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
while (!repoItemToFind.Exists(5000, out foundElement))
{
Keyboard.Press(System.Windows.Forms.Keys.Down, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
Delay.Duration(20);
}
// foundElement.EnsureVisible();
// foundElement.Click();
Keyboard.Press(System.Windows.Forms.Keys.Enter, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
Delay.Duration(20);
}
You do not have the required permissions to view the files attached to this post.
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