Contributions
Re: Unable to execute a batch file from TC using JS.
Thanks Helen Kosova for your reply. It was nice and clear and extactly what i was looking for :) I posted a related issue before but have't got any useful reply on that. Wondering if you can have a look on that.Executing Linux Commands from TC.3.1KViews0likes0CommentsUnable to execute a batch file from TC using JS.
I am trying to execute a .bat file that opens a FTP connection to a server and put a file on specified location. If i manually issue this command in the command prompt C:\>ftp -i -s:ftpConnection.bat It send out the mentioned file to the specified path. But i am unable to execute this script(ftpConnection.bat) from TC. I tied to it like below.. Sys.OleObject("WScript.Shell").Run("C:\\Windows\\System32\\ftp.exe -i -s:C:\\ftpConnection.bat"); It just opens a command prompt and the file is not sent to the destination. Event the command prompt exits immediately so unable to see the message. Searched a bit and found below link but couldn't make it to server my purpose. Calling a DOS command any idea how to do this form TC. Thanks.Solved3.9KViews0likes6CommentsExecuting Linux Commands from TC.
My script (JS) needs to cover environment setup. For that i need to 1. "SCP" a file to a Linux box. 2. "SSH" to that linux box. 3. Execute commands on that server. I am sure people has resolved this kind of issue before. May be i haven't got the proper documentation yet. And here is the link what i've tried so far. http://smartbear.com/forums/f81/t92684/how-to-execute-scp-and-ssh-commands-from-tc/#92716 Note: My current system in Win7. Hope to get some direction/pointer from SMARTBEAR. Thanks.1.3KViews0likes1CommentRe: How to execute SCP and SSH commands from TC.
Alexei Karasthanks for you post. I've installed openSSH in my system (win7) and able to do ssh like below... new ActiveXObject("WScript.Shell").Run("C:/cygwin64/bin/ssh ardome@HOST"); but unable to do scp in the same way.. new ActiveXObject("WScript.Shell").Run("C:/cygwin64/bin/scp FILE USER@HOST:"); Followed the shared tharead and tried like below but in this case ssh and scp nothing works. Sys.OleObject("WScript.Shell").Exec("C:\\cygwin64\\bin\\ssh.exe USER@HOST"); Sys.OleObject("WScript.Shell").Exec("C:\\cygwin64\\bin\\scp.exe FILE USER@HOST:"); Any idea what might possibley be gone wrong?1.5KViews0likes0CommentsHow to execute SCP and SSH commands from TC.
Hi Team, I am trying to Prepare Environment to automate a test and for that i need to run "scp" and "ssh" command from TC. Note: After doing ssh i also need to execute some other commands on that linux box(SLES). Currently i am doing it manually from cygwin. Not sure how can i do from TC. Followed this article http://support.smartbear.com/viewarticle/62782/ Tried like below var p, w; p = Sys.Process("C:\\cygwin64\\bin\\mintty.exe"); w = p.Window("ConsoleWindowClass", "*"); Getting this Error message. The process "C:\cygwin64\bin\mintty.exe" was not found. Any idea or pointer how can i do this?2.6KViews0likes2CommentsRe: getting an node's value from XML file.
Getting this error messge if i try as mentioned... In this tline.. var value = doc.selectSingleNode("/atom:entry/atom:inline/ns:payload/ns:field[@name='asset.title']/ns:value").text; Error: Object required Note: I've MSXML 4.0 SP3 Parser installed on by system. (Win 7 64 bit). So i made this change on your code. var doc = Sys.OleObject("Msxml2.DOMDocument.4.0"); //var doc = Sys.OleObject("Msxml2.DOMDocument.6.0");938Views0likes0Commentsgetting an node's value from XML file.
My XML file's structure is like this... <?xml version="1.0" encoding="utf-8" ?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:core="http://x.y.com/xy/xyz"> <atom:title>TestTitle</atom:title> <atom:link rel="a" href="$a_u"/> <atom:link rel="ot" href="$ou"/> <atom:link rel="db" type="app/c.d.p+xml" href="e.xml"> <atom:inline> <payload xmlns="http://www.yyy.com/xxx" model="https://xxxx.yyy.com/api/te/db/et/r1"> <field name="asset.title"> <value>DP</value> </field> <field> <value>xxx</value> </field> | | | </atom:inline> </atom:link> </atom:entry> I am trying to get the value "DP" of file whose name="asset.title" Followed this Doc's but no luck.. http://support.smartbear.com/viewarticle/57106/ http://support.smartbear.com/viewarticle/58850/ How can i get this value. Thanks in advance for any pointer or help.1.8KViews0likes2CommentsCan't finding TD's DIV using EvaluateXPath Method.
My scenario is like this.. <tr> <td> <td> <div>requirdText</div> <td> <td> <div>STATUS</div> <td> . . . </tr> I am trying to use EvaluateXPath method to find the "STATUS" if page contains "requiredText" Here is my XPath.. var obj = page.EvaluateXPath("//*[contains(text(), '" + text+ "')]/../../td[4]/div"); if ( obj !== null && obj !== undefined ) { var status = obj[0].innerText; Log.Message(status); } When i run the script it gives me below error... '0.innerText' is null or not an object Any idea what might possible be gone wrong or how can i my expected resut? Thanks in advance for you help.Solved1.6KViews0likes1Comment