Problem with scroll at table body web element
Problem with scroll at table body web element
I have some container in my application where html is generated and presented. Ranorex recognizes this as /dom element which is ok. In that container I have table body with table which cannot whole be placed so there issome scroll to scroll those table elements. Ranorex can detect table and normally scroll elements in this table, but the element which is in that table body and should be visible is not visible because this automatic scroll have appeared and element is beneath it. Technically, if there are no scroll element would be visible because is at the edge of this table body. Since ranorex thinks element is visible it clicks regular on place where is element. But since scroll is over that element click heappens to scroll, not to element. What can I do? If I scroll down a little bit some other element would be hidden by this scroll but in the t body area, so ranorex would think it is visible...
regards,
Vajda
regards,
Vajda
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Problem with scroll at table body web element
Hello Vajda,
repository elements and the according wrapper classes have a UseEnsureVisible attribute.
Check out this link:
http://www.ranorex.com/forum/what-s-def ... -t903.html
In your case you said you don't want it to automatically scroll. Therefore set it to false,
either using the properties view or in code:
Regards,
Roland
Ranorex Support Team
repository elements and the according wrapper classes have a UseEnsureVisible attribute.
Check out this link:
http://www.ranorex.com/forum/what-s-def ... -t903.html
In your case you said you don't want it to automatically scroll. Therefore set it to false,
either using the properties view or in code:
Code: Select all
Ranorex.TdTag td = "some/path/here";
td.UseEnsureVisible = false;
Roland
Ranorex Support Team
Re: Problem with scroll at table body web element
It seems I haven't been clear enough. I'm ok with that when ranorex scolls for element and click on it. But this one is beneath scroll so ranorex clicks on scroll and think it clicked on element.
My item is next in list after this double item, and click is performed exactly where is pin point of arrow.
When click is performed here scroll is just moved to right.
For all elements bellow this one ranorex normally scrolls and click on them, just for this one which is on border makes mistakes.
regards,
Vajda
My item is next in list after this double item, and click is performed exactly where is pin point of arrow.
When click is performed here scroll is just moved to right.
For all elements bellow this one ranorex normally scrolls and click on them, just for this one which is on border makes mistakes.
regards,
Vajda
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Problem with scroll at table body web element
Ahhh, now I understand the problem. Could you provide us a sample application that we can reproduce the problem with? And a Ranorex snapshot of your application?
Regards,
Alex
Ranorex Team
Regards,
Alex
Ranorex Team
Re: Problem with scroll at table body web element
I've a similar issue in the grids in our AUT.
I've written my own code to check for location of the cell to click versus the window rectangle and then check if the scroll bar is present and visible... If all things fit the parameters I have my code click the line down button once to make sure that the cell to click is not covered by the scrollbar.
I've written my own code to check for location of the cell to click versus the window rectangle and then check if the scroll bar is present and visible... If all things fit the parameters I have my code click the line down button once to make sure that the cell to click is not covered by the scrollbar.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
Re: Problem with scroll at table body web element
I cannot provide application sample since I'm not allowed, only ranorex snapshot of application. But I think it wouldn't be that hard for to make sample application with this situation.
@Ciege: I cannot locate this scrollbar with ranorex, only it's container which is some TBody element I think.
Do you have any sugesstions how to solve this?
Currently I just scroll down to the bottom of this table before start searching for elements and than no elements are behind scroll. But I would like to have some more elegant solution for this.
@Ciege: I cannot locate this scrollbar with ranorex, only it's container which is some TBody element I think.
Do you have any sugesstions how to solve this?
Currently I just scroll down to the bottom of this table before start searching for elements and than no elements are behind scroll. But I would like to have some more elegant solution for this.
Re: Problem with scroll at table body web element
Well if you can't find the scrollbar (not sure why not) you can also get the visible properties of the *NEXT* item in your view, which will be false if your current item is under the scrollbar. So if your next item is false, scroll down one.WajdaW wrote:@Ciege: I cannot locate this scrollbar with ranorex, only it's container which is some TBody element I think.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
Re: Problem with scroll at table body web element
Well, I think that could be time consuming. I have the solution for now, if something goes bad with it, I'll consider your suggestion. 

Re: Problem with scroll at table body web element
Really? It's maybe 3 - 5 lines of code... And an extra couple of seconds in run time...WajdaW wrote:Well, I think that could be time consuming. I have the solution for now, if something goes bad with it, I'll consider your suggestion.
Your "solution" of
introduces its own issues... What if your table is more than 2 pages long and the cell you want is on page 2? When you just scroll to the end of the table you will now be on page 3 and still unable to click the cell. What if you happen to run your code on a different machine with different resolution? Or if you happen to run with your AUT window not fully maximized? Etc...just scroll down to the bottom of this table before start searching for elements
In my experience, just "doing something" that works this time because it's the easy way out, is not necessarily doing the right thing. In test automation it really is up to the test developer to make your tests as bullet proof and future proof as possible. The more time and money you save in future maintainability of your code the quicker and better your ROI is. Just my 2 cents... I'm off my soapbox now...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Problem with scroll at table body web element
If you know the item just below the one you want to click at, you could first click on that item, which is outside the window area and therefore the visible area would be scrolled. Now you should also be able to see the one you want to click at.
Regards,
Roland
Ranorex Support Team
Regards,
Roland
Ranorex Support Team
Re: Problem with scroll at table body web element
Strange, it seems that ranorex today finds this element regular (scrolls and clicks on it), but fails to find some other elements which are even visible. Actually not fail like throws some exception, but instead clicks on some random place in document, which is even worse.
If element don't exist it should return timeout exception, not to click on random place in document.
Do you have any idea?
I can provide snapshots and ranorex path for those elements.
regards,
Vajda
If element don't exist it should return timeout exception, not to click on random place in document.
Do you have any idea?
I can provide snapshots and ranorex path for those elements.
regards,
Vajda
Re: Problem with scroll at table body web element
It comes to my mind.
Maybe this is a problem:
Here is how I use repository to find a element, maybe I don't use TableBody properly, or something like that...
Should I do this in some other way?
Regards,
Vajda
Maybe this is a problem:
Here is how I use repository to find a element, maybe I don't use TableBody properly, or something like that...
Code: Select all
public RF_ReportAppFolder(RepoGenBaseFolder parentFolder) :
base("RF_Report", "/dom", null, 60000, true)
{
_tabview = new rf_excel_sampletax_insert_factsRepositoryFolders.TabViewFolder(this);
_selfInfo = new RepoItemInfo(this, "Self", "", 60000, null);
}
...
public TabViewFolder(RepoGenBaseFolder parentFolder) :
base("TabView", "body/div/div/div/div/table/tbody/tr/td[@innertext='Presentation View']/../../../../../..", parentFolder, 60000, true)
{
_report_frame = new rf_excel_sampletax_insert_factsRepositoryFolders.Report_FrameFolder(this);
_selfInfo = new RepoItemInfo(this, "Self", "", 60000, false);
}
...
public Report_FrameFolder(RepoGenBaseFolder parentFolder) :
base("Report_Frame", "div[2]/div[1]/div[2]/div[1]/div[1]/iframe[1]", parentFolder, 60000, true)
{
_tablebody = new rf_excel_sampletax_insert_factsRepositoryFolders.TableBodyFolder(this);
_selfInfo = new RepoItemInfo(this, "Self", "", 60000, null);
}
...
public virtual rf_excel_sampletax_insert_factsRepositoryFolders.TableBodyFolder TableBody
{
get { return _tablebody; }
}
...
// I created my custom property like this
public TBodyTag TableBody
{
get
{
return Excel2007Repository.Instance.RF_Report.TabView.Report_Frame.TableBody.Self;
}
}
...
// and using this property to find items beneath it like this
ATag atag = TableBody.FindSingle("tr[5]/td[2]/a[1]", 300000);
atag.Click();
Should I do this in some other way?
Regards,
Vajda
Re: Problem with scroll at table body web element
Also I'm using FIndSIngle this way:
for some items when I want make some custom timeout in searching...
where LoginUserFIeld is Ranorex.Adapter
Is this regular?
Code: Select all
LoginUserField.FindSingle("", CustomTimeOut.SearchTime);
where LoginUserFIeld is Ranorex.Adapter
Code: Select all
public virtual Ranorex.Container LoginUserField
{
get
{
return _loginuserfieldInfo.CreateAdapter<Ranorex.Container>(true);
}
}
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Problem with scroll at table body web element
Hi,
We tried to reproduce your issues but it was all working as expected. Please can you send us a sample application which will allow us to reproduce your issues. Or could you send us a Ranorex Snapshot to [email protected] ?
Thanks in advance.
Regards,
Peter
Ranorex Team
We tried to reproduce your issues but it was all working as expected. Please can you send us a sample application which will allow us to reproduce your issues. Or could you send us a Ranorex Snapshot to [email protected] ?
Thanks in advance.
Regards,
Peter
Ranorex Team