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

use python in a jscript project

$
0
0

Hi I've inherited a TC jsscript desktop project, now I want to speed up some of the desktop tests by connecting to a rest-api. (I've done this in another project using python).

 

Is it possible for me to use this in this project without rewriting it entirely into python.


Connect TestComplete to Oracle database using Oracle Provider for OLE DB

$
0
0

I will share a ready-made solution to connect to the Oracle database but this time using a free driver called "Oracle Provider for OLE DB".

 

Below you will find the installation process and code examples:

 

1. Install a driver compatible with your version of TestComplete x86/x64
  a. Download "Oracle Instant Client Basic Package"

    Link: https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html
  b. download "ODBC Package"
    Link: https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html


2. Unzip both downloaded folders to one location for example (C:\ininstantclient_19_3)


3. Install the ODBC driver by running the file "odbc_install.exe" as an administrator


4. Verify the installed ODBC driver is correct:
  a. in the "Run" field, type "ODBC" and select the version that is compatible with the installed one
  b. go to the "Drivers" tab.
  c. verify if there is an entry with the installed position in it

sterownik-ODBC.png


5. Validate the set environment variables:
  a. PATH: Add "C:\ininstantclient_19_3"
  b. TNS_ADMIN: add "'C:\instantclient_19_3"

 

6. Select the "Net Configuration Assistant" program from the available applications.

konfigurator.png
  a. in the application, select the "Local Net Service Name configuration" option

Net-conf-01.png

b. in the next window select "Add"
c. then enter the database name in the "Service Name" field

Net-conf-02.png

d. Select "TCP" from the list of protocols
e. in the next window fill in "Host name" data e.g. host.com.pl, port 1521 (leave standard)

Net-conf-03.png

f. we're doing a connection test
g. in the launch field enter "ODBC"
h. select a version that is compatible with the selected system

i. in the ODBC panel add a new item with the "Add" button
j. we are completing the data of the newly added item:
  - "Data Source Name': "Driver_x64", used in ConnectionStrings scripts
  - "TNS Service Name": in the list, you should have the item configured in "Net Configuration Assistant", select and select
  -"UserID": "DatabaseUser"

adminODBC-01.png


k. after the correct configuration of the item select the "Test Connection" button.

 

NOTE: THE VERSION OF THE DRIVER USED MUST MATCH THE VERSION OF TESTCOMPLETE RUNNING

 

Example of a valid JS for connecting TC to Oracle database:

 

 

var connectstring = "Data Source=DataSourceName;User Id=User;Password=Pass;";
// [1]
  var query = ADO.CreateADOQuery();
  query.ConnectionString = connectstring;
  query.SQL = 
  `
    SELECT mrp.firma_mrp(1) AAAA FROM Firma
  `;
  query.Open();
  query.First();
  var res = query.FieldByName("AAAA").Value;
//[2]
  var conn = ADO.CreateCommand();
  conn.ActiveConnection = connectstring;
  conn.CommandType = adCmdText;
  conn.CommandText = 
  `  
    select * from akcje_log;
  `;
  var RecSet = conn.Execute();
  // Process the results
  Log.AppendFolder("Opisy_Akcji_Z_Logow");
  RecSet.MoveFirst();
  while (! RecSet.EOF )
  {
    Log.Message(RecSet.Fields.Item("OPIS_AKCJI").Value);
    RecSet.MoveNext();
  }

 

 

Helpful links:

Doc SmartBear:

https://support.smartbear.com/testcomplete/docs/reference/program-objects/ado/index.html

 

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/working-with-external-data-sources/databases/ado-components.html

 

https://support.smartbear.com/testcomplete/docs/reference/program-objects/ado/createcommand.html

 

Test Complete (14.20) hangs after waiting for Page ("*").

$
0
0

Hi All

 

Recently we have upgraded to 14.20 and while running the scripts that were recorded in 14.0  i see that the Test Complete is hanging. 

i had to kill Test Complete and rerecord the scripts , it runs for the first time and when i run it again after siging out from my system it shows a message of "Waiting for Page ("*") and its  hanging again

 

can some one please advise on whats going on .

 

After upgrade do i need to follow any steps as i directly opened my project from the location.

 

Thank you

Poornima

Test if variables are passed to function

$
0
0

I am writing a function but need to ensure all the proper variables have been passed with the call to the function...

 

From the function.....

// Obtains a variable collection
Variables = ProjectSuite.Variables;
Variables1 = Project.Variables;

if (!(Variables.VariableExists(Emp_Num) || Variables.VariableExists(Start_Date) || Variables.VariableExists(End_Date)))
{

 

I have included a copy of the watch list....the varialbes do exist....

 

What am i doing wrong with the "Variable.Exists"  ?????

 

NameMapping additions are disappearing and dialog indicates I have unsaved changes

$
0
0

The attached video shows

  • Me adding an entry to NameMapping.
  • Clicking SAVE.
  • Exiting TC. 
  • Opening TC.
  • Getting a dialog about unsave changes.
  • Observing mapping I created has disappeared.

Has anyone experienced this before?

UI and online documentation for JDBC requests not the same for versio 2.8.0. Is there a bug?

$
0
0

I am finding that when I select for a JDBC request the Stored Procedure box that I do not get the results that the documentation is saying that I should get.  Am I missing something or is there a bug?

 

When I click the Stored Procedure box the build query button goes away and nothing else is available (I have no Create Query dialog that opens). I have no query even started at the time I click the button so I do not have any output parameters. 

 

but the documenation says this:

Create a query with a stored procedure

To specify a call to a stored procedure in a query, do the following:

  1. Enable the Stored Procedure option.

  2. Click Create Query. It opens the Create Query dialog.

  3. Select the desired procedure and click OK.

 If the stored procedure includes output parameters, the Create Query dialog will not appear. To call a procedure that includes output parameters, do one of the following:

  • Disable the Stored Procedure option and write an SQL query manually using the SQL syntax.

—OR—

  • Create a Groovy Script test step and perform the needed operation via a script.

 

test for CBT

Update definition not updating / importing request json payload

$
0
0

I have a project that was started with a swagger.json URL. Since the initial creation of the project I was able to update the definition a few times and got new endpoints, request updates etc.

Then it stopped.

Now when I update definition new endpoints are added to the project but the jason payload of the request is not.

 

Is there a setting that controls this or a way to fix it. Its a bit of a pain to update the definiton then go to swager doc to verifiy the endpoint & add the json


UserForms click Radio Buttons Click

$
0
0

Hello Memebers,

 

I have a questions regrding UserForm radio buttons,

is it possible to click the radio buttons in userform click automatically if so please guide some documentation or any other alternatives please

 

regards

SivaKartheek Sreeram

Jenkins-slavce services Log On "this account"

$
0
0

Hi,

 

I have a problem with Jenkins and TestExecute 14.

I have virtual machine with jenkins-slave  and services Log On as domain users (jenkins-slave services -> Properties -> Log On tab -> I've checked "This account:" tester@domain.com)

I must have this configuration.


But when I run job with tests I have an issue:

[TestComplete] The test execution started (Impuls_trunk/Impuls_trunk/Personel|RejestracjaOsoby).
[TestComplete] Found TestComplete/TestExecute installations:
	Type: TC, Version: 14.20.2175.7, Path: "C:\Program Files (x86)\SmartBear\TestComplete 14\x64\bin\TestComplete.exe"
	Type: TE, Version: 14.20.2175.11, Path: "C:\Program Files (x86)\SmartBear\TestExecute 14\x64\bin\TestExecute.exe"
[TestComplete] Selected TestComplete/TestExecute installation:
	Type: TE, Version: 14.20.2175.11, Path: "C:\Program Files (x86)\SmartBear\TestExecute 14\x64\bin\TestExecute.exe"
[TestComplete] [WARNING] The node is connected via Java Web Start (JNLP). In this mode, the "Run interactive user session" property of the TestComplete Test step is ignored. TestComplete (or TestExecute) will work in the current user session.
[TestComplete] Launching the test runner.
$ "C:\Program Files (x86)\SmartBear\TestExecute 14\x64\bin\TestExecute.exe" C:\jenkins-slave-testexe1\workspace\TestExe1\Impuls_trunk\Impuls_trunk.pjs /run /SilentMode /ForceConversion /ns /exit /ExportLog:c:\jenkins-slave-testexe1\workspace\TestExe1\5907321.tclogx /ExportLog:c:\jenkins-slave-testexe1\workspace\TestExe1\5907321.htmlx /ErrorLog:c:\jenkins-slave-testexe1\workspace\TestExe1\5907321.txt /project:Impuls_trunk /test:Personel|RejestracjaOsoby /DoNotShowLog
[TestComplete] [ERROR] An exception occurred:
java.io.IOException: CreateProcess error=740, The requested operation requires elevation.
[TestComplete] Marking the build as FAILED.
[TestComplete] [WARNING] Unable to publish test results (xml data is empty).
[TestComplete] The test execution finished (Impuls_trunk/Impuls_trunk/Personel|RejestracjaOsoby).
Build step 'TestComplete Test' changed build result to FAILURE

 

Can anyone know how  to solve this issue?

Jenkins-slavce services Log On "this account"

$
0
0

Hi,

 

I have a problem with Jenkins and TestExecute 14.

I have virtual machine with jenkins-slave  and services Log On as domain users (jenkins-slave services -> Properties -> Log On tab -> I've checked "This account:" tester@domain.com)

I must have this configuration.


But when I run job with tests I have an issue:

[TestComplete] The test execution started (Impuls_trunk/Impuls_trunk/Personel|RejestracjaOsoby).
[TestComplete] Found TestComplete/TestExecute installations:
	Type: TC, Version: 14.20.2175.7, Path: "C:\Program Files (x86)\SmartBear\TestComplete 14\x64\bin\TestComplete.exe"
	Type: TE, Version: 14.20.2175.11, Path: "C:\Program Files (x86)\SmartBear\TestExecute 14\x64\bin\TestExecute.exe"
[TestComplete] Selected TestComplete/TestExecute installation:
	Type: TE, Version: 14.20.2175.11, Path: "C:\Program Files (x86)\SmartBear\TestExecute 14\x64\bin\TestExecute.exe"
[TestComplete] [WARNING] The node is connected via Java Web Start (JNLP). In this mode, the "Run interactive user session" property of the TestComplete Test step is ignored. TestComplete (or TestExecute) will work in the current user session.
[TestComplete] Launching the test runner.
$ "C:\Program Files (x86)\SmartBear\TestExecute 14\x64\bin\TestExecute.exe" C:\jenkins-slave-testexe1\workspace\TestExe1\Impuls_trunk\Impuls_trunk.pjs /run /SilentMode /ForceConversion /ns /exit /ExportLog:c:\jenkins-slave-testexe1\workspace\TestExe1\5907321.tclogx /ExportLog:c:\jenkins-slave-testexe1\workspace\TestExe1\5907321.htmlx /ErrorLog:c:\jenkins-slave-testexe1\workspace\TestExe1\5907321.txt /project:Impuls_trunk /test:Personel|RejestracjaOsoby /DoNotShowLog
[TestComplete] [ERROR] An exception occurred:
java.io.IOException: CreateProcess error=740, The requested operation requires elevation.
[TestComplete] Marking the build as FAILED.
[TestComplete] [WARNING] Unable to publish test results (xml data is empty).
[TestComplete] The test execution finished (Impuls_trunk/Impuls_trunk/Personel|RejestracjaOsoby).
Build step 'TestComplete Test' changed build result to FAILURE

 

Can anyone know how  to solve this issue?

Jenkins-slavce services Log On "this account"

Sopui 5.5.0 open source - HTTP status code assertion 200 does not work in Rest call response

$
0
0

I expect that my assertion for HTTP 200 fails here, but is does not even though there is no Http 200 in my response. Is this a bug in Sopui 5.5.0 open source?

Snag_1641b836.png

Data Source Generator

$
0
0

Hey All

Just looking to see if there is a way to change the country of origin in SoapUI to be Canada so that I can randomly generate Provinces instead of States?

In the Data Source Generator

$
0
0

Hey All Again

Any Chance the Data Source Generator that it can use Latitude and Longitude?  or would it be best to scrip those values?


getActiveXObject couldn't close file

$
0
0

Hi guys,

I'm using getActiveXObject to parse an xml file.

This instruction is in a function, when I call this function twice, I have an error, I suppose because file is already open.

So there is a method like 'close',  I need to close and reopen this file n-times.

Here is the function.

 

 

function Translate_Msg_Static(MessageKey) // Translate a dinamic message
{
var Doc, s, ChildNode, Path;


Doc = getActiveXObject("Msxml2.DOMDocument.6.0");

Doc.async = false;

// Load data from a file
// We use the file created earlier
Doc.setProperty("ProhibitDTD", false);
Doc.load(Get_Translate_Mgs_Static_File());


// Report an error, if, for instance, the markup or file structure is invalid
if(Doc.parseError.errorCode != 0)
{
s = "Reason:\t" + Doc.parseError.reason + "\n" +
"Line:\t" + aqConvert.VarToStr(Doc.parseError.line) + "\n" +
"Pos:\t" + aqConvert.VarToStr(Doc.parseError.linePos) + "\n" +
"Source:\t" + Doc.parseError.srcText;
// Post an error to the log and exit
Log.Error("Cannot parse the document.", s);
return;
}
// Catch dinamically the path to search
Path = "//translation[@id='" + MessageKey + "']";
// Search single node
ChildNode = Doc.selectSingleNode(Path);

// If node exists then translate message else return messagekey
if (ChildNode != null)
return ChildNode.text;
else
return MessageKey
}

 

thanks in advantage

Python BDD modules

$
0
0

Hi

 

Just getting started with TestComplete and BDD. I'm experienced with Python BDD (Behave) with Selenium. Just a little unsure how to work with python modules. I can't seem to import my classes currently. Wondered if anyone could point me in the right direction. I also wasn't sure how to create a .py file.

 

I included a file named "test", with no extension inside my Scripts folder. But not sure how to import that class into my step definitions?

 

tc.PNG

Error message when loading wsdl in soapui

Stop automatically recording automatically

$
0
0

Hi

 

I initially indicated to TestComplete that I wanted it to start recording straightaway. I'm since regretting that decision. But I'm unsure how to change this option so I can just start recording when I need to?

 

Thanks

 

Jonathon

Parametarize iterations from excel in BDD Scenario Outline

$
0
0

How can I read data from excel and parametarize in BDD Scenario Outline, using Javascript

Viewing all 21160 articles
Browse latest View live