编码的UI Chrome浏览器在退出[ClassInitialize]方法时关闭 [英] Coded UI Chrome Browser closes on exiting [ClassInitialize] method
问题描述
Internet Explorer在执行代码后保持打开状态,但如果浏览器是chrome,则退出该方法时窗口将关闭。帮我保持Chrome浏览器窗口的打开状态。
Internet Explorer stays open after executing code, but if the browser is chrome, the window gets closed on exiting the method. Help me to keep the Chrome browser window open.
_bw.CloseOnPlaybackCleanup = false;不适用于Chrome。
_bw.CloseOnPlaybackCleanup = false; doesn't work of Chrome.
[ClassInitialize]
      public static void LaunchBroswer(TestContext context)
      {
[ClassInitialize]
public static void LaunchBroswer(TestContext context)
{
          Playback.Initialize();
          BrowserWindow.CurrentBrowser =" Chrome"; $
          var _bw = BrowserWindow.Launch(new Uri(" http://www.bing.com"));
          proc = _bw.Process;
          _bw.CloseOnPlaybackCleanup = false;
      }
Playback.Initialize();
BrowserWindow.CurrentBrowser = "Chrome";
var _bw = BrowserWindow.Launch(new Uri("http://www.bing.com"));
proc = _bw.Process;
_bw.CloseOnPlaybackCleanup = false;
}
推荐答案
F irst,我不会说英语,你了解我吗?好吧:
First, I don't speak english, You understand me? well:
在你的视图中html:
in your view html :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
添加如果你使用javascript,把debug();和F12在开发者工具行中行
Add if your use javascript, put the debug(); and F12 in developer tools line for line
对不起我的英语
这篇关于编码的UI Chrome浏览器在退出[ClassInitialize]方法时关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!