MuraliKola / robotframework-seleniumlibrary

Automatically exported from code.google.com/p/robotframework-seleniumlibrary
Apache License 2.0
1 stars 0 forks source link

Add keywords for checking whether element has scrollbars #209

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I may submit a patch with the requested enhancement later on, but in either 
case, entering issue for tracking purposes and as FYI.

I came across this need in another Selenium project. Perhaps a corner seldom 
used case, but there may be times this would be a useful keyword.

Suggested keywords:

* Element Should Contain Vertical Scrollbar
* Element Should Not Contain Vertical Scrollbar
* Element Should Contain Horizontal Scrollbar
* Element Should Not Contain Horizontal Scrollbar

Can be implemented similar to this PHP code snippet, where $this is the 
selenium object:

//adapted from 
http://selenium-automation.blogspot.com/2010/10/selenium-automation-problems.htm
l

        if($orientation == "vertical"){
            $locatorHeight = $this->getEval("this.browserbot.findElement(\"".$locator."\").clientHeight");
            $scrollHeight = $this->getEval("this.browserbot.findElement(\"".$locator."\").scrollHeight");
            if($locatorHeight < $scrollHeight){
                return TRUE; //scrollbar appears
            }else{
                return FALSE; //scrollbar not appear
            }
        }else{ //$orientation == "horizontal"
            $locatorWidth = $this->getEval("this.browserbot.findElement(\"".$locator."\").clientWidth");
            $scrollWidth = $this->getEval("this.browserbot.findElement(\"".$locator."\").scrollWidth");
            if($locatorWidth < $scrollWidth){
                return TRUE; //scrollbar appears
            }else{
                return FALSE; //scrollbar not appear
            }

Original issue reported on code.google.com by manga...@gmail.com on 17 Oct 2011 at 2:38

GoogleCodeExporter commented 8 years ago
forgot to mention "." serves also can serve as string concatenator in PHP 
snippet above.

Original comment by manga...@gmail.com on 17 Oct 2011 at 2:59

GoogleCodeExporter commented 8 years ago
I agree that these seem quite borderline keywords, but since they are quite 
difficult to implement as user keywords, I think we can consider adding them.

Original comment by janne.t....@gmail.com on 17 Oct 2011 at 5:25

GoogleCodeExporter commented 8 years ago
Selenium RC has been deprecated and developing this library is thus ending. 
Selenium 2 (a.k.a. WebDriver) and Selenium2Library are the way forward. If you 
feel this issue is important, consider submitting it to the issue tracer of 
Selenenium2Library project.

Original comment by pekka.klarck on 4 May 2012 at 10:29