Forum Discussion
- karkadilValued Contributor
- karkadilValued ContributorFrom the code you posted I can see that you have a complicated framework here, it is not just "recorded steps".
The problem may be anywhere! There might be hundreds of reasons for the fails!
You have 2 options:
Ask someone who is experienced in your framework to help you.
Debug the test, running it step-by-step, and find out the issue.
Any of these solutions exceeds forum help, sorry. - karkadilValued ContributorMost probably the form which appears after you click the btnExecutar takes a lot of time to load and field edtUsuario doesn't exist when you try to enter text into it.
Try increasing timeout for wait operations as described here
http://support.smartbear.com/articles/testcomplete/test-playback-performance-tips/#tip_5
If it doesn't help, then start debugging and searching for the reason - karkadilValued ContributorIt depends on the code you are trying to run. Without looking at it, it is impossible to help.
- karkadilValued ContributorThen post here the script you recorded from the scratch and specify where exactly you experience the problem.
But still, it is possible that answers will be general and will not give you exact answers. It depends. - nicktulettContributorThat seems unlikely. The script is probably just running faster than the application.
As Gena said, use the Wait methods rather than assuming all objects are available immediately.
Also look at how to launch applications via TestedApps rather than relying on clicking things in Explorer. - thalesvoleiOccasional Contributor
I'm trying to run the steps recorded in TestComplete. When I go running, the system displays a message "An exception occurred in the" TemplateEfetuarLogin "unit at line 17:
Runtime error Microsoft JScript
Invalid procedure call or argument "
Please help me, I could not find solution on the site mentioned above - thalesvoleiOccasional Contributor
//USEUNIT DadosEfetuarLogin
//USEUNIT dadosentrada_CT_01_EfetuarLogin
//USEUNIT dadosentrada_CT_02_NaoInformarLogin
//USEUNIT TemplateEfetuarLogin
//USEUNIT TemplateMetodoTeste
function CT_01_EfetuarLogin(){
//CARREGAR A MASSA DE DADOS
dadosentrada_CT_01_EfetuarLogin.CT_01_carregarDadosEntrada();
//ABRIR O SEI
TemplateMetodoTeste.templateMetodoTeste();
//TEMPLATE COM OS PASSOS DO TESTE
TemplateEfetuarLogin.executarTeste();
//Fechar o SEI
TemplateMetodoTeste.fecharSEI();
}
Unit 2
var login = null;
var senha = null;
var clicarPerfilIntercambioLocalProducao = new Boolean();
var escolherPerfilIntercambioLocalProducao = null;
var perfilAcesso = null;
unit 3
//USEUNIT DadosEfetuarLogin
function executarTeste(){
sei = Aliases.SEI;
tfrmLogin = sei.frmLogin;
campoUsuario = tfrmLogin.edtUsuario;
campoSenha = tfrmLogin.edtSenha;
perfilAdm = tfrmLogin.CB_ADM;
perfilEnf = tfrmLogin.CB_ENF;
perfilMed = tfrmLogin.CB_MED;
desmamrcar = cbUnchecked;
marcar = cbChecked;
if ( DadosEfetuarLogin.login != null ){
campoUsuario.wText = DadosEfetuarLogin.login;
}
if ( DadosEfetuarLogin.senha != null ){
campoSenha.wText = DadosEfetuarLogin.senha;
}
if ( DadosEfetuarLogin.clicarPerfilIntercambioLocalProducao ){
if ( DadosEfetuarLogin.escolherPerfilIntercambioLocalProducao == 'intercambio' ){
tfrmLogin.RadioGroup1.TGroupButton.ClickButton();
}
if ( DadosEfetuarLogin.escolherPerfilIntercambioLocalProducao == 'local' ){
tfrmLogin.RadioGroup1.TGroupButton1.ClickButton();
}
}
if ( DadosEfetuarLogin.perfilAcesso != null ){
perfilAdm.ClickButton(desmamrcar);
perfilEnf.ClickButton(desmamrcar);
perfilMed.ClickButton(desmamrcar);
if ( DadosEfetuarLogin.perfilAcesso == 'ADM' ){
perfilAdm.ClickButton(mamrcar);
}
if ( DadosEfetuarLogin.perfilAcesso == 'ADM ENF' ){
perfilAdm.ClickButton(mamrcar);
perfilEnf.ClickButton(mamrcar);
}
if ( DadosEfetuarLogin.perfilAcesso == 'ADM MED' ){
perfilAdm.ClickButton(marcar);
perfilMed.ClickButton(marcar);
}
if ( DadosEfetuarLogin.perfilAcesso == 'ENF' ){
perfilEnf.ClickButton(marcar);
}
if ( DadosEfetuarLogin.perfilAcesso == 'END MED' ){
perfilEnf.ClickButton(marcar);
perfilMed.ClickButton(marcar);
}
if ( DadosEfetuarLogin.perfilAcesso == 'MED' ){
perfilMed.ClickButton(marcar);
}
}
//Clicar no botão "Entrar"
tfrmLogin.Acessa.ClickButton();
}
UNIT 4
function templateMetodoTeste(){
//Esse bloco serve para iniciar o SEI (clicar no ícone)
explorer = Aliases.Explorer;
explorer.wndProgman.SHELLDLL_DefView.FolderView.DblClickItem("Lacador", 0);
explorer.dlgAbrirArquivoAvisoDeSeguran_a.btnExecutar.ClickButton();
//
}
- thalesvoleiOccasional ContributorThe unit 1 is the "class" test. The other "classes" are references to implement the Unit 1
- thalesvoleiOccasional ContributorSometimes the test works, sometimes does not work. If I run the test now may be passing, and turning again it may not pass