Skip to content

Instantly share code, notes, and snippets.

View solanoize's full-sized avatar

Solanoize solanoize

View GitHub Profile
@solanoize
solanoize / doc.md
Created November 29, 2025 20:20
SupplierForm JTable Example (Java Swing)

This example shows how to configure a JTable in a Java Swing form (SupplierForm) with:

  • Custom DefaultTableModel
  • Editable columns
  • ComboBox in a specific column

Code

public SupplierForm() {
@solanoize
solanoize / Trouble1.java
Created November 18, 2025 12:57
Troubleshot
// 1. Buat objek ChromeOptions
ChromeOptions options = new ChromeOptions();
// 2. Siapkan Map untuk menyimpan preferensi
Map<String, Object> prefs = new HashMap<String, Object>();
// -- MENONAKTIFKAN POPUP TERSEBUT --
// Matikan fitur "Offer to save passwords"
prefs.put("credentials_enable_service", false);
@solanoize
solanoize / App01.java
Last active November 5, 2025 14:15
SQA Batch 25 Day 04
package com.juaracoding.labs;
public class App {
public static void main(String[] args) throws Exception {
int[] nilaiPeserta = {1, 4, 6, 8, 1};
// 0 1 2 3 4
System.out.println(nilaiPeserta[0]);
// System.out.println(nilaiPeserta[6]); // error: diluar jangkauan
package com.juaracoding.labs;
public class App {
public static void main(String[] args) {
/**
* Implicit casting (casting otomatis)
*/
// int i = 124_000_000; // kapasitas int di i, ukurannya lebih kecil dari kapasitas long di l.
// long l = i;
ChromeOptions options = new ChromeOptions();
options.addArguments("--start-maximized");
options.addArguments("--disable-web-security");
options.addArguments("--no-proxy-server");
Map prefs = new HashMap();
prefs.put("credentials_enable_service", false);
prefs.put("profile.password_manager_enabled", false);
options.setExperimentalOption("prefs", prefs);
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<mainClass>com.sqabatch24.javadasar.App</mainClass>
</configuration>
</plugin>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.skorlife</groupId>
<artifactId>Skorlife</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
@solanoize
solanoize / pm.js
Created June 3, 2025 12:51
Script pengujian postman
pm.test("Response status code must be 200", function () {
pm.response.to.have.status(200);
});
pm.test("Response time is less than 1.5 seconds", function () {
pm.expect(pm.response.responseTime).to.be.below(1500);
});
pm.test("Response must be object", () => {
const responseData = pm.response.json();
const { results, count, next, previous } = responseData;
pm.expect(responseData).to.be.an('object');
// implementasi BasePage pada Page Object Model untuk skip error jika tidak ditemukan elemen
public class BasePage {
protected WebDriver driver;
protected WebDriverWait wait;
protected List<String> missingElements = new ArrayList<>();
public BasePage(WebDriver driver) {
this.driver = driver;
this.wait = new WebDriverWait(driver, Duration.ofSeconds(5));
}
CREATE TABLE `sales_db`.`owner` (
`id` INT NOT NULL AUTO_INCREMENT ,
`username` VARCHAR(40) NOT NULL ,
`password` VARCHAR(200) NOT NULL ,
`fisrtName` VARCHAR(40) NOT NULL ,
`lastName` VARCHAR(40) NOT NULL ,
PRIMARY KEY (`id`),
UNIQUE (`username`)) ENGINE = InnoDB;