Monday, June 27, 2016

Stop IIS Apppool only when it is Started using appcmd

In order to stop IIS apppool using appcmd only when apppool is started I used following command

%windir%\system32\inetsrv\appcmd list apppool /name:MyAppPoolName /state:Started /xml | %windir%\system32\inetsrv\appcmd stop apppool /in


Wednesday, June 22, 2016

Robocopy exit code 0

In order Robocopy to exit code 0, I used following

(robocopy C:\Source D:\Destionation /e /move /np /njh /njs) ^& IF %ERRORLEVEL% LEQ 4 exit /B 0

Tuesday, June 21, 2016

Get text from the textbox using Selenium 2.0

In order to get text from the textbox using Selenium 2.0 I used following

String myText = driver.FindElement(By.XPath("//input[@id='myTextBox']")).GetAttribute("value");

Wednesday, June 08, 2016

Get parameter and enviornment variable in Jenkins 2.0 pipeline job's Groovy script

In order to get Pipeline job parameter (defined by user) in the Groovy script I used following

${ENV:environment}

while to get enviornment variables to the Pipeline job I used following

$env.BUILD_NUMBER

Friday, June 03, 2016

Allow HTML report containing inline scripts and styles in Jenkins

In Order Jenkins to display HTML reports which uses JS and CSS, I executed following command from Manage Jenkins => Scripe Console

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP","sandbox allow-scripts allow-same-origin; default-src 'self'; script-src 'self' 'unsafe-inline'; img-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';")