Quantcast
Channel:
Viewing all articles
Browse latest Browse all 43798

Forum Post: RE: Silk4J - NullPointerException trying to use scroll bar

$
0
0
Hi, Generally speaking SilkTest/Silk4J should automatically try to scroll an item into view before interacting with it. If you explicitly want to bring the Dom control into view, the setFocus method could be used as an alternative, e.g.: desktop. DomElement find("//DIV[@textContents='myItem']").setFocus(); With regards to the null value returned by getHorizontalBar(), it is likely that the horizontal scrollbar in question does not belong to the BrowserApplication and is likely associated with a Dom control within the BrowserWindow. You can confirm this by recording locators and hovering the mouse over the scrollbar in question and verifying the locator generated. When you have the locator something similar to the following could be used (Internet Explorer only) to scroll to the right edge: //This DomElement has an associated ScrollBar DomElement bw = dt. DomElement find("/BrowserApplication//BrowserWindow//BODY[@leftMargin='0']"); //Get the rectangle of the element in question Rect bwRect = bw.getRect(); //Right click the scroll bar bw.click(2, new Point(50, bwRect.getHeight()-5)); //Click the Right Edge menu item dt. MenuItem find("/BrowserApplication//BrowserWindow//MenuItem[@caption='Right edge']").click(); Replace the following with your locator: /BrowserApplication//BrowserWindow//BODY[@leftMargin='0'] Let me know if this helps. -Robert

Viewing all articles
Browse latest Browse all 43798

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>