robotframework / OldSeleniumLibrary

Deprecated Selenium library for Robot Framework
Apache License 2.0
13 stars 3 forks source link

Add keywords for checking whether element has scrollbars #209

Closed spooning closed 9 years ago

spooning commented 9 years ago

Originally submitted to Google Code by mangaroo on 16 Oct 2011

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:

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.html

    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
        }
spooning commented 9 years ago

Originally submitted to Google Code by mangaroo on 16 Oct 2011

forgot to mention "." serves also can serve as string concatenator in PHP snippet above.

spooning commented 9 years ago

Originally submitted to Google Code by @yanne on 16 Oct 2011

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.

spooning commented 9 years ago

Originally submitted to Google Code by @pekkaklarck on 4 May 2012

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.