Contributions
Re: Getting no response when I run the following database connection script from Groovy[Soapui]
The above code is correct. Just added the code below: // instead of this st.executeQuery(sql) // do something like java.sql.ResultSet rs = st.executeQuery(query); and then iterate results as described here - https://docs.oracle.com/javase/tutorial/jdbc/basics/processingsqlstatements.html#processing_resultset_objects while (rs.next()) { String value = rs.getString("COLUMN_NAME"); log.info("COLUMN_NAME:"+value) } Original post -http://stackoverflow.com/questions/40570226/getting-no-response-when-i-run-the-following-database-connection-script-from-gro?noredirect=1#comment68399274_405702261.2KViews0likes0CommentsRe: Running a external Selenium Python script from Grrovy script using SOAPUI
This problem is now resolved. Using the following script: def cmdArray2 = ["python", "C:/Users/Desktop/SOAPProject/test.py"] def process = new ProcessBuilder(cmdArray2).redirectErrorStream(true).start() process.inputStream.eachLine { log.warn(it) } process.waitFor() return process.exitValue()8.3KViews2likes1CommentGetting no response when I run the following database connection script from Groovy[Soapui]
I am trying to run this script from Groovy[soapUI] but i am not getting errors and not the sql command is not returning any results. am I missing anything crucial here? import groovy.sql.Sql import java.sql.* import com.jcraft.jsch.JSch import com.jcraft.jsch.Session // ssh login String sshHost = 'test.com' String sshUser = 'test' String sshPass = 'test' int sshPort = 22 // database login targetHost = 'localhost' targetUser = 'test' targetPass = 'test' targetPort = 3306 lport = 4328 JSch jsch = new JSch(); Session session = jsch.getSession(sshUser, sshHost, sshPort); session.setPassword(sshPass); session.setConfig("StrictHostKeyChecking", "no"); System.out.println("Establishing Connection..."); session.connect(); int assinged_port=session.setPortForwardingL(lport, targetHost, targetPort); Connection con = null; String driver = "org.mariadb.jdbc.Driver"; String connectionString = "jdbc:mariadb://" + targetHost +":" + lport + "/"; con = DriverManager.getConnection(connectionString, targetUser, targetPass); Statement st = con.createStatement(); String sql = "select * from SS_System.tblcompanies where companyid=495555" st.executeQuery(sql); st.close() session.disconnect()Solved1.2KViews0likes1CommentRe: Running a external Selenium Python script from Grrovy script using SOAPUI
Yes when I run it from shell outside SOAPUI, it works fine. Here is the code below: from selenium import webdriver driver = webdriver.Chrome() driver.maximize_window() driver.get('https://google.Companydata')8.4KViews0likes0CommentsRe: Unable to run selenium code from grrovy script(SOAPUI)
I can compare jars and see if its possible to make it work. Please see my comments regarding using Python from a shell -https://community.smartbear.com/t5/SoapUI-Open-Source/Running-a-external-Selenium-Python-script-from-Grrovy-script/m-p/1307512.1KViews0likes0CommentsRe: Running a external Selenium Python script from Grrovy script using SOAPUI
Thank you so much for your post. Just one more thing I wanted to know about this. When I run your code with only print "Hello" it works fine. But when I have the seleniumcode in it(which opens the browser and configure things on the UI) it does not work. It is strange to me. Do you think I am missing anything here? Same with the SOAP PRO version, it does not work there either.8.4KViews0likes3Comments