Window Switching

How to write script for browser window switching ?

I have used switchTo method for this but the prob is that two url opened in the browsers i.e. brow1 and brow2
by using switchTo concept i m not able to focus in brow1 window still the focus is set to the current opened browser

did u means you want to do open something in new tab of same browser ?? [Context click is an option for that]

I am also not sure if switchTo can be applied at browser level, I think it can be applied to an element in DOM ?? virender sir please clarify.

OR did u mean u open a browser and multiple small small browser windows are opened by default like advertisement windows and u want to switch to one of these windows ??

 

on April 22, 2015.

Hi Amit,

It seems that Ravi is referring to switch windows only.  SwitchWindow works well in case of browser windows but doesnt work when use for tabs.

I think if Ravi shares more code, we will be able to identify the problem.

Thanks for you participation Amit!! it is much appreciated by the Toolsqa  team.

Virender

on April 23, 2015.
Add Comment
2 Answer(s)

Can you share some code?

Virender Singh Professor Answered on April 21, 2015.
Add Comment

Hi Virender/Amit,

ToolsQA Team is really appreciable. I am quite busy with developing the framework and will also participate in your ways.

It worked with driver.switchTo().defaultContent();  method.  i have created a separate method for switching tabs.

but i m not sure whether this is reasonable for the framework or is there any alternative solution ?

raviiichauhan85 Train Answered on April 23, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.