Skip to content

Instantly share code, notes, and snippets.

View gauravkhuraana's full-sized avatar
💭
www.udzial.com

Gaurav Khurana gauravkhuraana

💭
www.udzial.com
View GitHub Profile
@gauravkhuraana
gauravkhuraana / DateSortedInJson.cs
Created April 30, 2024 10:49
To check if dates in a list of json are sorted or not
{
"Date": "2022-04-01T00:00:00Z",
"Number": 1
},
{
"Date": "2022-04-01T00:00:00Z",
"Number": 1
},
List<AllDataFromJson> AllDataFromJson = JsonConvert.DeserializeObject<List<MyObject>>(json);
@gauravkhuraana
gauravkhuraana / getDayOfTheWeek
Last active May 20, 2022 06:05
Groovy Script to get the particular day of a week
// I have used this in SOAPUI for Groovy scripting
def date = new Date()
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
def day = calendar.get(Calendar.DAY_OF_WEEK);
def map=[
1:"Sunday",
@gauravkhuraana
gauravkhuraana / Clear Log-output groovy step.groovy
Created October 18, 2017 05:10
Clear log-output for soapui Groovy script.
// Remember script log and log-output are different things. The below script is for the log-output which comes below the log-output
//Note that in ReadyAPI 2.1 you will need to use the following script:
import com.eviware.soapui.SoapUI
log.info("test")
//Writing to the log is executed in the separate thread, so it is need to wait some time to get all notifications.
sleep(1000)
def teststep = context.getCurrentStep()
def tesStepPanel = SoapUI.getDesktop().getDesktopPanel(teststep)
Groovy Script to run a test case steps in SoapUI
YOu can disable all steps apart from the Groovy step and paste the below code