Search This Blog

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.