Search This Blog

March 5, 2019

How to update the time zone in Azure Devops?

I started my new job last December and I got the chance to learn something about Azure Devops (Visual Studio Online).

Today I notice one thing: If I created the pull request, after team members approved it, I marked it Complete. Why was the timestamp set to UTC time zone?

After looking into this interesting issue, I finally find out one fact: the default time zone is set to UTC in Azure Devops. If we would like to change it to pacific time, we can just go to this link and update the time zone to Pacific Time.

 After updating it and going to my pull request again, the time zone has been updated to Pacific Time.

September 20, 2018

DesiredCapabilities is obsolete in Selenium Web Driver v.3.14, How to write the code for Selenium Grid in C#?

I upgraded Selenium Web Driver and Support to v3.14.  Noticed that the following code showed the error.  

DesiredCapabilities capabilities; --deprecated  
capabilities = DesiredCapabilities.Chrome();  --has the error 
capabilities.SetCapability(CapabilityType.Platformnew Platform(PlatformType.Windows));  
Uri uri = new Uri(hub url);  
_driver = new RemoteWebDriver(uri, capabilities, TimeSpan.FromSeconds(120));  

From the class RemoteWebDriver in OpenQA.Selenium.Remote, it still has the ICapabilities parameter.  
public RemoteWebDriver(Uri remoteAddressICapabilities desiredCapabilitiesTimeSpan commandTimeout) 

After posting the question in stackflowone nice guy replied. I created a new branch , updated the following code , set up the private branch in bamboo and ran BVTs in the Selenium Grid. The tests passed.  

ChromeOptions options = new ChromeOptions(); 
options.PlatformName = PlatformType.Windows.ToString(); 
Uri uri = new Uri(hub url); 
_driver = new RemoteWebDriver(urioptions.ToCapabilities(), TimeSpan.FromSeconds(120)); 

September 5, 2018

Many Selenium tests fail using Chrome headless

I need to run 9 BVTs and 74 core tests every day in my machine.  Last week, I ran them in parallel using Chrome or Chrome headless. Here was the test result:

If I run 519 parallel tests in Selenium using Chrome headless , can you imagine how many tests will fail?  I would say running a lot of tests in Chrome headless is not  a good idea even if the duration is so short. 

August 21, 2018

How to get the value from the textbox in Selenium?

Today one colleague asked me one question. If he entered the value in the textbox, how to get that value from textbox in C# and Selenium ?  

It is simple. You can use GetAttribute("value") to achieve your goal.  

        public string GetTextBoxValue(IWebElement textBoxElement) 
            return textBoxElement.GetAttribute("value");