Aberdeen will face Spanish side Real Sociedad if they can overcome Groningen in their second qualifying round of the Europa League.
Sociedad, who finished seventh in La Liga last season, will host the first leg of the third-round tie on 31 July with the return scheduled for 7 August.
Aberdeen drew 0-0 with Groningen in the first leg of their second-round clash.
St Johnstone will tackle Zestafoni of Georgia or Slovakian side Spartak Trnava if they can convert their 1-1 draw in their second-round first-leg tie with Lucern into an aggregate victory in Perth on 24 July.
If Motherwell get past their Icelandic opponents Stjarnan - they drew the first leg 2-2 at Fir Park - their reward will be a match with either Nomme Kalju of Estonia or Poland's Lech Poznan.
UEFA Europa League third qualifying round draw:
Karabukspor v Rosenborg/Sligo Rovers
Chornomorets v RNK Split/Hapoel Beer Sheva
Lucerne/St Johnstone v FC Zestafoni/FC Spartak Trnava
Mainz v RoPS/Asteras Tripolis
Litex Lovech/Diosgyor VTK v Sillamae Kalev/Krasnodar
Mlada Boleslav/Siroki Brijeg v Lyon
AS Trencin/Vojvodina v Hull City
Buducnost Podgorica/Omonia Nicosia v Metalurg/Zeljeznicar Sarajevo
Torino v Brommapojkarna/Crusaders
PSV v Botev Plovdiv/SKN St Polten
Motherwell /Stjarnan v Nomme Kalju/Lech Poznan
Laci/FC Zarya Lugansk v Molde FK/HiT Gorica
FK Sarajevo/Haugesund v Atromitos
Real Sociedad v Aberdeen/FC Groningen
Astana/Hapoel Tel-Aviv FC v Linfield/AIK
Zulte Waregem/Zawisza Bydgoszcz v Derry City FC/Shakhtyor
Cukaricki Belgrade/SV Grodig v CSKA Sofia/FC Zimbru
FC Astra Giurgiu v MFK Kosice/Liberec
Ruch Chorzow/FC Vaduz v Kairat Almaty/Esbjerg
Dinamo Moscow v Hapoel Kiryat Shmona
Young Boys v Ermis Aradippou
IF Elfsborg/Inter Baku v Neman/FH Hafnarfjordur
Petrolul Ploiesti /Flamurtari Vlore v Plzen
Vikingur/Tromso v Rijeka/Ferencvaros
Dinamo Minsk/MyPa v CFR Cluj-Napoca/FK Jagodina
Neftchi/Koper v Bursaspor/Chikhura Sachkhere
Gyori/IFK Goteborg v Rio Ave
Club Brugge v Brondby
FK Atlantas/Shakhtyor Karagandy v Dundalk/Hajduk Split
Ties to be played 31 July and 7 August