This is a migrated thread and some comments may be shown as answers.
Problem with Chrome tabs
4 Answers 42 Views
This is a migrated thread and some comments may be shown as answers.
Juan
Top achievements
Rank 1
Juan asked on 22 May 2012, 06:33 PM
Hi everyone!

I'm having a problem with Chrome, the web site that I;m automating is opening an unexpected page in a second tab in Chrome. I've read that is possible to disable the tabs in other browsers, but in chrome is impossible disabling the tabs.

The problem is that I don't know hot to return to my first tab (the SetFocus method doesn't work for this)
Could someone know how to manage the tabs in Chrome?

See the attached image with an example

Please advice,
Thanks!

4 Answers, 1 is accepted

Sort by
0
Juan
Top achievements
Rank 1
answered on 23 May 2012, 04:45 PM
Any ideas?
Does my question make sense?

Please advice!!!
0
Anthony
Telerik team
answered on 23 May 2012, 05:31 PM
Hello Juan,

I recommend using key presses to accomplish this. If the second tab doesn't have focus, first ensure it's active:

Manager.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control);
Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Tab);
Manager.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control);

Then you can close it:

Manager.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control);
Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.W);
Manager.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control);

Focus should return to the first tab where you can continue your automation.

Kind regards,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Juan
Top achievements
Rank 1
answered on 24 May 2012, 03:29 PM
Thank you Anthony!

I'm going to use the code that you suggested me, but to return to my first tab using Ctrl+1.

I just want to report to you guys, that something is happening with the Chrome Extension, because only when I run my test in Chrome, I get the Internet Explorer and Safari web pages. Do you have reports about something like that?

Thanks,
Juan
0
Anthony
Telerik team
answered on 24 May 2012, 09:47 PM
Hello Juan,

I'm not sure what you mean. Can you provide more information?
  • Does your website render differently based on what browser is used?
  • If so, are you saying that when executing in Chrome it presents the IE/Safari version of your site?
  • If so, does this occur manually in Chrome when not executing with Test Studio?

Kind regards,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Asked by
Juan
Top achievements
Rank 1
Answers by
Juan
Top achievements
Rank 1
Anthony
Telerik team
Share this question
or