Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Manual Operations(TTCN perform Manual Operations)
Manual Operations [message #1726473] Mon, 14 March 2016 08:40 Go to next message
Philipp Kaaden is currently offline Philipp KaadenFriend
Messages: 3
Registered: November 2015
Junior Member
Hello,

I wanted to ask if there is a built-in functionality in titan that allows to let something like a Msgbox popup and pauses the Testcase execution until the user clicks ok.
It would be used to allow manual interaction between TC and user e.g. for Hardware Reset or cable disconnection by the user while the TC waits.
More or less the Testcase tells the User in a MsgBox what to do and the user has to perform this action and then click ok.
In TTCN there is already a action() command but it seems only to be used for logging.
Of course I could implement a Testport that does that but I wanted to ask if there is already such a functionality.

Thanks Philipp
Re: Manual Operations [message #1726477 is a reply to message #1726473] Mon, 14 March 2016 09:11 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Philipp,

not that I know of; I suppose this is a consequence of the philosophy of TTCN, which sees itself as a close system communicating with the external world via test ports only.


A simple , but sub-optimal solution to this would be the usage of timers:


timer t:=20.0;
t.start;
action("do something");
t.timeout;


but I admit this is not very practical as it keeps the operator on toes all the time and extends execution unnecessarily.

Best regards
Elemer

[Updated on: Mon, 14 March 2016 09:12]

Report message to a moderator

Re: Manual Operations [message #1726528 is a reply to message #1726477] Mon, 14 March 2016 12:59 Go to previous messageGo to next message
Gustavo Gonnet is currently offline Gustavo GonnetFriend
Messages: 36
Registered: October 2015
Location: Montreal, Quebec, Canada
Member
Hi Philipp,

some time ago, I had to achieve something similar to your case. This is what I did at the time:

1- I used a tcp listener (already existing in Titan) to listen in a specific port (example: listen in port 9010)
2- I coded a pause function that would pause the testcase and listen for an event (any event for that matter) in this port 9010
3- whenever I wanted the test to continue, I opened my browser (chrome, firefox) and directed it to the IP of the computer running Titan, port 9010, example: http://12.13.14.15:9010
4- the browser hits the listener port, the pause function will detect a request in the listener then continue with the flow of the testcase
5- now that the browser is directed to the titan listener, if the pause function is called again all it takes is a refresh (F5 in most browsers) to un-pause again my test

alternatively, you could replace the browser with a more sophisticated GUI button coded in whatever language of your choice, but the browser did the job for me Smile

hope it helps!
Gustavo.
Re: Manual Operations [message #1726907 is a reply to message #1726528] Thu, 17 March 2016 11:44 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Philipp,

this could be solved using the PIPE test port:

https://github.com/eclipse/titan.TestPorts.PIPEasp

please check the /demo

The following code:

testcase TC_basic0() runs on PIPE_CT {
  map(self:PIPE_PCO, system:PIPE_PCO);
  
  // start nedit, should be stopped manually
  // execution stops here until nedit exits with 0
  PIPE_PCO.send(t_PExecute("nedit yyy_PLEASE_CLOSE_MANUALLY", "abcd"));

alt {
 [] PIPE_PCO.receive(t_PResult(?, ?, 0)) -> value v_ASP_PResult {
      log("PResult msg received: ", v_ASP_PResult);
   }
}
unmap(self:PIPE_PCO, system:PIPE_PCO);

}



will start a nedit window with a message, and exec will continue only after
user presses "exit nedit";
of course , instead of nedit , some other executable can be used.

Best regards
Elemer

[Updated on: Thu, 17 March 2016 12:44]

Report message to a moderator

Re: Manual Operations [message #1726923 is a reply to message #1726907] Thu, 17 March 2016 13:24 Go to previous message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Philipp,

a simplified version with xterm:
testcase TC_simple() runs on PIPE_CT {
  map(self:PIPE_PCO, system:PIPE_PCO);

  PIPE_PCO.send(t_PExecute("xterm -hold -e echo DO SOMETHING!!!! ", "abcd"));


  alt {
	[]PIPE_PCO.receive(t_PResult(?, ?, 0));
	}

  unmap(self:PIPE_PCO, system:PIPE_PCO);

  setverdict(pass);
}


BR Elemer

Previous Topic:Order of members of type in a template
Next Topic:Titan UDP example project
Goto Forum:
  


Current Time: Fri Apr 26 23:25:22 GMT 2024

Powered by FUDForum. Page generated in 0.03962 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top