made_in_india
made_in_india

Reputation: 2279

How to reach the buttom of the page using Selenium::Remote::Driver in perl?

I am writing a test script for website where a button appears as the user reach end of the page and list of various option.

So I am trying to reach the bottom of the page of the website.

     my $driver= Selenium::Remote::Driver->new;
     $driver->get('http://www.test.com');

Is there any way to do it?

Upvotes: 1

Views: 55

Answers (1)

made_in_india
made_in_india

Reputation: 2279

achieved the objective using javascript

     my $script = q{window.scrollTo(0,document.body.scrollHeight);};
     my $elem = $driver->execute_script($script);

Upvotes: 1

Related Questions