Add new network configuration (SSID + Password)
network={
ssid="testing"
psk="testingPassword"
}
into
sudo vim /etc/wpa_supplicant/wpa_supplicant.conf
After saving new network details, reconfigure the wifi connection using
sudo wpa_cli -i wlan0 reconfigure
You can verify the connectivity with checking the ip address:
sudo ifconfig wlan0
and/or ping a server
ping 1.1.1.1