Hi ,
I was just wondering that, can I launch multiple tabs in a window via web-driver?
What i found it just a workaround of sending <Control + t> via send_keys. Is their any other clean method.
After that, As I get window handle for each tab I can switch focus to any of the tab via focus command and operate on the tab. Here is the focus method i have overridden in my way.
# to get all handles of the tabs --> set lWindows [[$::IB::WEB::browser session] windows]
method focus {args} {
set options(-handle) ""
array set options $args
if { $options(-handle) eq "" } {
set json "{ \"name\": \"$_handle\" }"
set expectedHandle $_handle
} else {
set json "{ \"name\": \"$options(-handle)\" }"
set expectedHandle $options(-handle)
}
set interval 10
for {set i 0} {$i < 5} {incr i} {
set response [::WebDriver::Protocol::dispatch -query $json \
[$_session session_url]/window]
::itcl::delete object $response
if { [[$_session active_window] handle] eq $expectedHandle } {
break;
}
after $interval
set interval [expr $interval * 2]
}
if {$i == 5} {
raise ::WebDriver::UnknownError "failed to activate window."
}
}
Also can I launch, different windows under same session?
I think, there will be a way for that, as all I am getting all the windows handles, then I should be able to launch as well.
But didn't find a way.
Need Assistance.
Thanks,
Sushant