Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Selenium with Bitbucket pipeline is causing "Timed out waiting for driver server to start"

Akhil
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 24, 2020

Hi,

I was working on some simple automatic test cases using selenium in my Bit bucket pipeline Below is my yml 

image: maven:3.6.1

#!yaml
options:
max-time: 10 # configure default 10 minute timeout

pipelines:
default:
- step:
caches:
- maven
script: # Modify the commands below to build your repository.
- mvn -Dtest=ApplicationTests test

 when executing -mvn -Dtest==ApplicationTests test in my cmd, the test cases are executing absolutely fine but when I exectue the same command in pipeline I'm geitting the below exception

2020-04-24 15:55:11.690 ERROR 92 --- [ null to remote] org.openqa.selenium.os.OsProcess : org.apache.commons.exec.ExecuteException: Process exited with an error: 127 (Exit value: 127)org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'System info: host: '952e449d-6cd1-4feb-8f33-d76b1a81eb7c-47n4q', ip: '10.38.40.85', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.95-flatcar', java.version: '11.0.4'Driver info: driver.version: ChromeDriver

 

From the exception, it can be understood that the exception is caused due to time out. Now the question is, is there a way to increase the timeout so that it waits for some time for the server to start? Below is my code:


@SpringBootTest
class ApplicationTests {
private WebDriver driver;

@Test
void contextLoads() {
System.out.println("Hello!!");
try {
WebDriverManager.chromedriver().setup();
//System.setProperty("webdriver.chrome.driver", "C:\\Users\\Akhil\\Desktop\\Selenium\\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().deleteAllCookies();
driver.manage().window().maximize();

//Page synchronization
driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
driver.manage().timeouts().pageLoadTimeout(100, TimeUnit.SECONDS);
driver.get("http://www.edureka.co");
}
catch(Exception e){
e.printStackTrace();
}
}


}

 

Thanks in advance.

Akhil. 

1 answer

0 votes
Sandeep.Dash
Contributor
March 24, 2021

Hi Akhil,

Did u get an answer to this or have you resolved this? Please let me know. I am facing the same issue related to driver timeout. I have posted my question in Atlassian community. Please check once. Below is the link to it:

https://community.atlassian.com/t5/Bitbucket-Pipelines-questions/Build-getting-failed-in-bitbucket-pipelines/qaq-p/1640917

 

Build failure part 2.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events