Answered by:
Chrome launch issue with VSTS 2013\15 coded UI

Question
-
HI,
Previously i was facing chrome browser launching issue in coded ui and via the solution mentioned in the below link the issue got solved but the script pattern of the solution is very much like webdiver script.
https://social.msdn.microsoft.com/Forums/en-US/af69b973-c68b-49b3-86b2-75117060e1b3/chrome-launch-issue-with-vsts-201315-coded-ui?forum=vstest&prof=required
The suggested code is mentioned below.
RemoteWebDriver driver = null; driver = new ChromeDriver(); try { driver.Manage().Window.Maximize(); // Navigate to Bing driver.Navigate().GoToUrl("https://www.bing.com/"); Thread.Sleep(5000); // Find the search box and query for webdriver var element = driver.FindElementById("sb_form_q"); element.SendKeys("quantity"); Thread.Sleep(10000); } catch (Exception e) { Debug.WriteLine(e.Message); } finally { if (driver != null) { driver.Quit(); } }
I am using a library frame work, is there any way through which i can incorporate the solution in my framework just like the way i coded, as the project is already completed, Please find my sample code.
public static void TextBoxInput(string Text, string TextBoxID)
{
try
{
Playback.PlaybackSettings.AlwaysSearchControls = true;
BrowserWindow br = new BrowserWindow();
if (BrowserWindow.CurrentBrowser.ToLower().Trim() == "ie")
{
br.SearchProperties[
UITestControl.PropertyNames.ClassName] = "IEFrame";
}
else
{
br.SearchProperties[
UITestControl.PropertyNames.Name] = WinTitle;
}
HtmlEdit txtBox = new HtmlEdit(br);
txtBox.FilterProperties[
HtmlEdit.PropertyNames.ClassName] = "HtmlTextBox";
txtBox.SearchProperties[
HtmlEdit.PropertyNames.Id] = TextBoxID;
UITestControlCollection utcc = txtBox.FindMatchingControls();
HtmlEdit txt = (HtmlEdit)utcc[0];
txt.Text =
"";
Keyboard.SendKeys(txt, Text);
}
catch (PlaybackFailureException e)
{
Assert.Fail(e.Message);
}
}
Thanks
AL
- Edited by anish lokre Monday, October 24, 2016 12:06 PM
Monday, October 24, 2016 10:52 AM
Answers
-
Hi anish lokre,
Please remember to mark any helpful replies from your previous threads you posted. And there is no any updates for selenium for Coded UI Test, we just could use V53 version of chrome.
Sincerely,
Oscar
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- Marked as answer by anish lokre Wednesday, February 8, 2017 9:02 AM
Wednesday, February 8, 2017 6:30 AM
All replies
-
Hi Anish
As the issue appears purely to do with loading the the browser no you shouldn't have to rewrite your framework you just need to modify it to incorporate the fix you've been given.
Monday, October 24, 2016 11:50 AM -
Hi anish lokre,
According to your description, you want to run the test scripts in Chrome. Based on the following MSDN document and the blog. We could run the recorded script in Chrome:
https://msdn.microsoft.com/en-us/library/jj835758.aspx
As my opinion, if you record it with Coded UI Test builder, I suggest you run it with IE. And if you hand code it with selenium, you could run it with Chrome or other browsers. Which could help us speed up the testing efficiency.
Sincerely,
Oscar
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.Tuesday, October 25, 2016 5:18 AM -
Hi Oscar,
Please let me know if I use your suggested framework (Code ) as mentioned below and change my framework to your suggested style , do it will support the current version and future version of chrome also?
RemoteWebDriver driver = null;
driver = new ChromeDriver();
try
{
driver.Manage().Window.Maximize();
// Navigate to Bing
driver.Navigate().GoToUrl("https://www.bing.com/");
Thread.Sleep(5000);
// Find the search box and query for webdriver
var element = driver.FindElementById("sb_form_q");
element.SendKeys("quantity");
Thread.Sleep(10000);
}
catch (Exception e)
{
Debug.WriteLine(e.Message);
}
finally
{
if (driver != null)
{
driver.Quit();
}
}Thanks
AL
Wednesday, November 16, 2016 5:39 AM -
Hi anish lokre,
The code is selenium test framework, we could only play back the coded UI test script on chrome, but there are compatibilities between selenium and current version chrome in coded UI. And I think engineers will evaluate this issue seriously.
You could add comments under this link.
Sincerely,
Oscar
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.Friday, November 18, 2016 9:24 AM -
Hi Oscar,
Any update on the above chrome issue?
Thanks
AL
Wednesday, February 8, 2017 6:24 AM -
Hi anish lokre,
Please remember to mark any helpful replies from your previous threads you posted. And there is no any updates for selenium for Coded UI Test, we just could use V53 version of chrome.
Sincerely,
Oscar
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- Marked as answer by anish lokre Wednesday, February 8, 2017 9:02 AM
Wednesday, February 8, 2017 6:30 AM