Quantcast
Channel: New board topics in SmartBear Community
Viewing all 20755 articles
Browse latest View live

How to Learn Proper SoapUI Coding

$
0
0

I'm using 5.4.0 Open Source and I think one of the problems learning SoapUI is it is too flexible.  There are many ways to do the same thing.  So I'm wondering if there are any books, tutorials, videos out there that might say things like "Use the Setup Script for this and the teardown script for that, when to use properties vs variables (they seem the same to me).  I'd also like to learn how multiple assertions work - I've heard that if one fails, it skips the other assertions. 

 

I've read and watched a ton of 'tutorials' but none of them cover what I'm looking for.

 

How would the creators of SoapUI write their code.  It looks like they are trying to enforce things like encapsulation with their scoped variable and code separation with the setup and teardown script sections.

 

Thanks in advance.


Get the id of a parent element by a sub-child value of Json response using groovy

$
0
0

I have following groovy script to get the values from response text. 

import com.eviware.soapui.support.XmlHolder
import groovy.json.JsonSlurper 

def response = context.expand( '${GetLoansList#Response}' ).toString()
log.info(response)

def slurper = new JsonSlurper()
def json = slurper.parseText response

log.info(json.items.id)

my json is similar to this 

{
   "items" : [
      {
         "id" : 48223,
         "name" : "LAI-00151007",
         "amount" : 25050.0,
         "interest_rate" : 25.99,
         "term" : 60,
      },
      {
         "id" : 48262,
         "name" : "LAI-00152581",
         "amount" : 44225.0,
         "interest_rate" : 18.9,
         "term" : 36,
      },
   ],
   "total_count" : 13
}

I want to get the corresponding ID for the given name ("name": "LAI-00152581",). What is the best way to do this? Thanks 




WSDL not recognized for web service

$
0
0

Hi Team,

 

I am trying to import the below 3rd party wsdl in SOAPUI. But it throws out an error. Could some one help me in fixing this.

https://ws3.ondemand.qas.com/ProOnDemand/V3/ProOnDemandService.asmx?wsdl

I have tried the below approach, but no result.

  1. Importing the wsdl in SOAPUI.
  2. Opened the wsdl in a browser and saved as a New XML file and tried Importing the file in SOAPUI.
  3. I exported a certificate from the browser and added to the ketstroke in SOAUI, and imported the wsdl, still it did not work.

 

  1. Error1.pngError2.pngKeystore.png

Thanks

Senthil kumar. M

API vs UI Testing: Join the exciting online event on March 25-29

$
0
0

Hi Guys,


Starting next Monday, March 25, we are launching an exciting online event to identify specifics of API and UI testing.
Each day, we will publish a topic to discuss, and we are looking forward to your active participation. You are the experts here! Only you can tell us what it is like to test APIs or UIs. Leave comments to score points to your team: API Testing or UI Testing.

 

The team with the biggest score will win. The most active participants from each team will be rewarded with special prizes from SmartBear.

 

Bookmark this page:

https://community.smartbear.com/t5/custom/page/page-id/API-Testing-vs-UI-Testing

 

I'm looking forward to seeing all of you participating in this event on March 25.

TanyaAPIvsUI_400.png

 

API vs UI Testing: Join the exciting online event on March 25-29

$
0
0

Hi Guys,


Starting next Monday, March 25, we are launching an exciting online event to identify specifics of API and UI testing.
Each day, we will publish a topic to discuss, and we are looking forward to your active participation. You are the experts here! Only you can tell us what it is like to test APIs or UIs. Leave comments to score points to your team: API Testing or UI Testing.

 

The team with the biggest score will win. The most active participants from each team will be rewarded with special prizes from SmartBear.

 

Bookmark this page:

https://community.smartbear.com/t5/custom/page/page-id/API-Testing-vs-UI-Testing

 

I'm looking forward to seeing all of you participating in this event on March 25.

TanyaAPIvsUI_400.png

 

Connection timeout when connecting to mongo db through groovy script through open source soap ui

$
0
0

I have been trying to connect to mongodb using the following groovy script through open source soap UI. 

I have already plaved gmongo 1.5 jar and mongo java driver jar 3.10.1 in soap ui lib folder.

I use soap ui 5.3.0 version. Mongo db version is 3.6 

I have added SSL settings in preferences, included truststore file.

-------------------------------------------------------------------------------------

import com.gmongo.GMongo
import com.mongodb.BasicDBObject
import com.mongodb.DB
import com.mongodb.DBCollection
import com.mongodb.DBCursor
import com.mongodb.*
import com.mongodb.MongoException

 

def javaMongo = new MongoClient(new MongoClientURI("mongodb://<username>:<password>@serverSmiley Tongueort/env?ssl=true&replicaSet=XXX"))


def db = javaMongo.getDB('XXX')
def table = db.getCollection("XXX");

 

def query = new BasicDBObject("XXX", "XX")

def cursor = table.find(query)

try {
while(cursor.hasNext()) {
log.info cursor.next()
}
} finally {
cursor.close()
}

--------------------------------------------------------------------------------

But I get the following error :

 


com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches com.mongodb.client.internal.MongoClientDelegate$1@7ff24094. Client view of cluster state is {type=REPLICA_SET, servers=[{address=XXX:XXX, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names matching IP address XXXXX found}, caused by {java.security.cert.CertificateException: No subject alternative names matching IP address XXXXXX found}}] error at line: 25

 

 

I have tried using this script as well:

------------------------------------------------------------------

@Grab('com.gmongo:gmongo:1.5')

import com.gmongo.GMongoClient
import com.mongodb.MongoCredential
import com.mongodb.ServerAddress
import com.mongodb.BasicDBObject
import com.mongodb.*


ENV = 'XXX'

def global_config = [
stage: [ database: 'XXX', username: 'XXXX', password: 'XXXX', server: 'XXXX', port: XXX ]
]
def config = global_config[ENV];

def credential = MongoCredential.createMongoCRCredential(config.username, config.database, config.password as char[])
def mongo = new GMongoClient(new ServerAddress(config.server, config.port), [ credential ])
def db = mongo.getDB(config.database)
log.info db

def collection1 = db.getCollection("XXXXX")


log.info collection1.find().first()

 

--------------------------------------------------------------------

This gives me the following exception:


com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=XXXX:XX, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Exception receiving message}, caused by {java.net.SocketException: Connection reset}}] error at line: 31

 

Have also included changes in testrunner.bat file:

set java_opts=%java_opts% -dsoapui.https.protocols=TLSv1,TLSv1.2,SSLv3

set JAVA_OPTS=%JAVA_OPTS% -Dsoapui.browser.disabled="true"

 

Added this in vmoptions file:

-Dsoapui.https.protocols=SSLv3,TLSv1.2
-Dsun.security.ssl.allowUnsafeRenegotiation=true

 

Also imported truststore file in the project level, WS-Security Configurations tab.

Inspite of all these changes, I see the connection issue.

Please help me in resolving the errors and help in connecting to the db.

project properties

$
0
0

The JDBC test step has the Fetch Size input, where it is expecting an Integer.

 

I wonder whether or not this could be populated by a Custom Property set at the Project level.

 

Somehow, I would have expected this ${#Project#Property} to be a valid input. Apparently, it isn't.

Get VB Script Unit Name from Distributed Testing setup

$
0
0

Hi,

 

I am currently running distributed tests with the following hierarchy

  1. Individual VB Scripts with a list of sub routines
  2. A Driver VB Script which runs all the sub routines from 1.
  3. A Job which contains a Task to run the Driver VB Script
  4. This Job is then added to the project explorer as a test item
  5. A Scheduled Task runs the Project 

 

I have a function that will output the CPU & Memory usage for 2 exes as to a csv file.

I want to call this function from each individual sub routine (in 1. above) as i want output the CPU & Mem usage.

I have tried the "Project.TestItems.Current.ElementToBeRun.Caption"  but with no luck. I get :

 
VBScript runtime error.
Object required: 'Project.TestItems.Current'

 

My code is below. My question is how can i get down to unit level in order to get the sub routine name to log to the file.

 

Sub CPU_Mem_Usage

Dim VerFileName, VerInfo, TestItems, tName
VerFileName = "\\MyPC1\c\program files\MyExe\MyExe.exe"
Set VerInfo = aqFileSystem.GetFileInfo(VerFileName).VersionInfo

sFolder = "\\Server1\TestComplete\FutaTill\Results\"
aqFileSystem.CreateFolder(sFolder)
sPath = sFolder & "\Build_"&VerInfo.FileFullVersion&"\Build_"&VerInfo.FileFullVersion&".csv"
tName = Project.TestItems.Current.ElementToBeRun.Caption

 

If Not aqFile.Exists(sPath) Then
Call aqFile.Create(sPath)
Call aqFile.WriteToTextFile(sPath, "CPU & Memory Usage Statistics for My Exe Build Version " & VerInfo & vbCrlf , aqFile.ctANSI, False)
Call aqFile.WriteToTextFile(sPath, "Test Date & Time: " & aqDateTime.Now & vbCrlf , aqFile.ctANSI, False)
Call aqFile.WriteToTextFile(sPath, "" & vbCrlf , aqFile.ctANSI, False)
Call aqFile.WriteToTextFile(sPath, "Time, Script Name,,,,,,,MyExe, CPU (%), Mem Usage (K),, MyExe2, CPU (%), Mem Usage (K)" & vbCrlf , aqFile.ctANSI, False)
Call aqFile.WriteToTextFile(sPath, "*****************************************************************************************************************************************" & vbCrlf , aqFile.ctANSI, False)
End If

Call aqFile.WriteToTextFile(sPath, aqDateTime.Time & "," & tName & ",,,,,,,," & Sys.Process("MyExe").CPUUsage & "," & Sys.Process("MyExe").MemUsage & "," & ",," & Sys.Process("MyExe2").CPUUsage & "," & Sys.Process("MyExe2").MemUsage & vbCrlf , aqFile.ctANSI, False)
End Sub

 

All help greatly appreciated

 

Thanks,

Jimmy

 


Unable to run testcomplete test from QAComplete

$
0
0

Hello All, 

 

I have created a test from test library in QAComplete and in the automated tab, I have given the path wheree testcomplete project suite is located and the in the project field, I have the provided the path which is <project name>\Script\<UnitName>\<routine name>. 

 

When I try to run the test, it opens testcomplete but does not the run the test. It shows the test has "Failed" status, but not sure why it is not executing the test. 

 

Please let me know what may be the issue. 

 

Regards,

 

Nimish

 

 

Access Violation in module ACEOLEDB.DLL

$
0
0

We are getting Acess Vilation at address 000007FEE43C4C6F in module 'ACEOLEDB.DLL'. Read address of 0000000000000.How to handle this. After closing and reopening the test complete it works fine.

How to Save PDF file to text format

$
0
0

Hi All, 

 

I need to use TestComplete to save the PDF file into text format. The scenario is as follow :

 

Scenario 

1) It is a web based application. In the application there is button,when I click on the button it will show dialog box below.

 

Dialogbox_forPDF.JPG

 

2) I am able to open the PDF file by clicking on the PDF button. 

3) PDF file open in Adobe Reader, now I need to Save the PDF as text format by going to File - SaveAsOther and select the Text option 

4) I tried the recording this part, but it is not working as well not reliable. Also tried using shell script with the send keys but it is not Saving it. 

I am not sure what is the issue.For the sendkeys my assumption is that it is not able to work on the PDF file,but then I tried activating and also maximizing it but it does not work. Please let me know if you have better or reliable solution 

 

Below is my code :-

 

Function func_SavePDFToText(arg_FolderPath)

'Aliases.browser.BrowserWindow.FrameNotificationBar.Wa
'Click on the open button to open the PDF File
If Aliases.browser.BrowserWindow.FrameNotificationBar.Exists Then
Call Aliases.browser.BrowserWindow.FrameNotificationBar.Click 'this statment to have the focus on the notificaton bar
Call Aliases.browser.BrowserWindow.FrameNotificationBar.Item.buttonOpen.ClickButton
End If

If Sys.WaitProcess("AcroRd32 *32",1000).Exists Then

Call Aliases.AcroRd323.wndAcrobatSDIWindow.Activate
Call Aliases.AcroRd323.wndAcrobatSDIWindow.Maximize
'Save the PDF file to Text
Set oShell = CreateObject("WScript.Shell")
oShell.SendKeys("%Fhx")
Delay(500)
strFileName=Aliases.browser.dlgSaveAs.DUIViewWndClassName.Explorer_Pane.FloatNotifySink.ComboBox.Edit.wText
oShell.SendKeys(arg_FolderPath&"\"&strFileName&func_CreateDateTimeStamp()&".txt")
Delay(500)
oShell.SendKeys"{ENTER}"
oShell.SendKeys("^%Fx")
func_SavePDFToText=strFileName
End If

 

Testing with pdf files (AI driven testing)

$
0
0

Hello Community

 

we are about to test the functionality from the AI driven testing extension.

 

Sadly we came very fast to a rather unpleasant "bug/feature". We try to test a pdf that get generated from a webpage when clicking on a button with all the values (configs) from the webpage. Sadly when you validate for specific texts it only passes when the specified text in the pdf is actually visible.

 

Is there a way to find / check through the whole pdf file?

 

Or are there other ways to work with the AI plugin / any good documentations about it how to test pdf files

Run Testcase return properties empty

$
0
0

Run Testcase Return properties are empty when test execution runtype = parallel 

I have a Run Testcase step with return propeties, properites are returning back when testsuite runtype = parallel 

 

where as its working fine on sequential runtype 

 

Ready Api version - 2.6 or 2.5 tried both the versions 

 

Run Testcase options :     create isolated copy of each run 

                                         

 

SubmitListener.afterSubmit - gather all codes from http400 responses

$
0
0

Hi community.

 

I have a nice little script that needs some tweaking to get it working properly and would really appreciate your help.

 

Use Case: I want to verify which http400 Bad Request error codes my testcases cover. From developers I have a list of implemented codes, so it would be nice to see that my test project covers all of these. If not, then I know I miss some scenario's. An example of a bad request results typiacally in this response with one code and one or more errors.code values:

 

HTTP/1.1 400 Bad Request

{
"code": 1,
"message": "Technical failure.",
"errors": [
{
"code": 51,
"message": "This field is mandatory.",
"description": "Additional description.",
"field": "target[0].type"
},
{
"code": 51,
"message": "This field is mandatory.",
"description": "Additional description",
"field": "target[1].type"
},
{
"code": 83,
"message": "Other message.",
"description": "",
"field": ""
}
]
}

 

So I am interested in all above code values.

 

My piece of groovy script for SubmitListener.afterSubmit at event level works fine when I do a run at test step level, but when I run from test case level (or test suite or project) it goes wrong. The context.expand below does no longer returns the expected value 1, but "" skipping the step that pushes this value to the listArray. Same for those at errors.code level. So it seems that depending on the context where the test is run the context.expand is not the same.

The values for my status (responseheader) and for my stepName (submit.request.getName()) does always provide met the correct test tesult I can see in my logs, irregardles of run context. So I assume I have to find a way to replace the context.expand with a submit.getResponse() somehow? But how do I get my code and errors.code values?

 

Mighty thanks in advance for anyone who might guide me to help this issue!!!

 

import com.eviware.soapui.support.JsonUtil
import groovy.json.JsonSlurper

String endpoint = submit.request.getEndpoint()
if (endpoint.contains("myEndPointUnderTest.be")) {
        // errorCodeList is defined as empty array [] in my project setup script
        def listProperty = context.expand('${#Project#errorCodeList}')
        def listArray = new JsonSlurper().parseText(listProperty)
        String status = submit.getResponse().getResponseHeaders() "#status#"
        //log.info "response for endpoint "+ endpoint + " from submitListener event handler  " +status
        if (status.contains("400")) {
            def stepName = submit.request.getName()
    		  log.info ("stepName: " + stepName)
		  def code = context.expand('${'+stepName+'#Response#$[\'code\']}')
		  if (code != ""){
		  log.info ("Code to add :" + code)
            listArray.push(code)}def errors = context.expand('${'+stepName+'#Response#$[\'errors\'][*]}')
            if (errors != "") {
                def numberOfErrorCodeArray = JsonUtil.parseTrimmedText(errors)
                int numberOfErrorCodes = numberOfErrorCodeArray .size()
                for (i = 0; i < numberOfErrorCodes ; i++) {
                    def errorCode = context.expand('${'+stepName+'#Response#$[\'errors\'][' + i + '][\'code\']}')
                    listArray.push(errorCode)
                    log.info "and for this step : " + stepNaam + " we add following error codes " + errorCode +" to the listArray"
                    log.info "total= " + listArray
                }
            }
        }
        def step = submit.getRequest()
        log.info("final listArray = " + listArray)
        def testcase = step.getTestCase()
        def testsuite = testcase.getTestSuite()
        def project = testsuite.getProject()
        project.setPropertyValue("errorCodeList", listArray.toString())

FYI: In my project teardown I gather all these values, sort and get the unique values:

 

log.info "------ HTTP400 ERROR CODES covered ------"
def listProperty = context.expand('${#Project#errorCodeList}')
def listArray = new JsonSlurper().parseText(listProperty)
// sort Array
listArray.sort()
int n =  listArray.size()
int res = 0
def uniqueList = []
for (i=0;i<n;i++){
while (i< n-1 && listArray[i] == listArray[i+1]){
	i++
	}
	res ++
	uniqueList.push(listArray[i])
}
log.info (res+ " unique (error)codes checked in my project run. This is the full list covered: "+ uniqueList.toString())

 

 

 

QAComplete and test run. Gap in test execution

$
0
0

Howdy folks... ok, have a suite of about 60 tests.... have them scheduled... and executed on remote system....

 

In the past few weeks... I have noticed an extra long test execution timen for the suite... the suite should run in about 17 hours.... but has been running over 27 hours etc....

 

Upon investigation, I see, ,randomly, and nor repeatable at will... I see soem tests taking... 2 hours to run, these are 10 to 15 minute tests... but they show show as taking over 2 hours... 

 

My last run had 59 tests... but 5 of these took over 2-3 hours,,, again, should only take 10 to 15 mins.

 

I have been unable to determine why yet... it is random tests and times so its not the same tests, and time of day... its random.  

 

In QAComplete the log displays nothing for those tests when  it happens... all tests before and after, fine and dandy log shows info.... but for the ones that appear to go into the twilight zone... log contains no data.

 

I look for the test log for these tests in TEST COMPLETE and there is nothing there... those tests dont show.... when that happens to them.

 

And yes, the next run... next night, those same tests will run fine and it will happen to a handful mof other tests....

Strange.


Issue with Importing WSDL in Windows 8

$
0
0

When I try to Import WSDL for a new WSDL/SOAP Project, I get the following error. I have Windows 8. This works perfectly in Windows 10 with the same WSDL

 

Error loading [file:\C:\Program%20Files%20(x86)\SmartBear\SoapUI-5.5.0\bin\submit_bookstore_artran.xsd]: java.io.FileNotFoundException: C:\Program Files (x86)\SmartBear\SoapUI-5.5.0\bin\submit_bookstore_artran.xsd (The system cannot find the file specified)

 

Thank you

Afshin

 

Input Parameter Error

$
0
0

Hello!

 

What does the error message "Cannot get a picture object from the input parameter" mean?

 

I have a comparison command that takes a picture from a region of a PDF file to be used as a Checkpoint. I keep getting the same error message. I checked and made sure with object spy that the object mapping is correct. So I think there are issues with my input parameters.

 

Comparison command:

Regions.NOCHANGES.Check(Regions.CreateRegionInfo(Aliases.Acrobat.wndAcrobatSDIWindow.AVFlipContainerView.AVDocumentMainView.AVFlipContainerView.AVSplitterView.AVSplitationPageView.AVSplitterView.AVScrolledPageView.AVScrollView.AVPageView, 182, 447, 547, 233, false), false, false, 0, 8);

 

Thank you!

Demo website for learning web testing with TestComplete

$
0
0

There is a good demo app that ships with TestComplete that one can use for learning. I wonder if they also have a website that they (you) host that can be used to the same purpose. Thanks

TestExecute, running without being logged in

How to upload .xlsx in a html page

$
0
0

In our web application, we upload an .xlsx file with data to be processed and send to backend afterwards.

 

I try to add this file in the attachment section and select Media Type: multipart/form-data, but after processing the request I get this error message: Required MultipartFile parameter 'file' is not present

 

What am I doing wrong, and how can I create a scenario like this with Ready API?

 

Any help is much appreciated. 

Viewing all 20755 articles
Browse latest View live