I am trying to open new tab in firefox using selenium::Remote::Driver in perl language, i am using below code, i am getting error as"Can't call method "send_keys" on an undefined value at D:/workspace/SamplePerl_project/sample.pl line 9."can you please suggest me how to open a new tab or new window in firefox in perl language...please help me...thanks in advance..
**sample.pl**
use Selenium::Remote::Driver;
use Selenium::Remote::WDKeys;
my $driver = new Selenium::Remote::Driver;
if(defined $driver)
{
print "driver is defined";
$driver->get("https://www.google.co.in/");
$driver->set_implicit_wait_timeout(40000);
#$driver->send_modifier('Ctrl','t');
$driver->find_elements("body")->send_keys(KEYS->{'Ctrl','t'});
}
I am using send_keys method for that i got error as"Can't call method "send_keys" on an undefined value ",i am using send_modifier for that also i got error as"Error while executing command: Server returned error code 404 and no data at",please help me.
find_elements
returns elements. Plural. You are unable tosend_keys
on an array of objects.What you want is: