Delete a TestSet in ALM using OTA - hp-uft

So, I'm SLOWLY working my way to having a painful manual process automated in ALM using OTA. My current struggle is deleting a test set. It just doesn't do anything - no error, no deletion, nothing. It's like the line of code isn't even there. Although, it's definitely doing something cause ALM is working funky now.
I've tried different things: Delete, RemoveNode. Any advice is appreciated.
Set qcConnection = QCutil.QCConnection
Set tsFolder = qcconnection.TestSetTreeManager.NodeById(224)
Set tstestList = tsFolder.FindTestSets("", False, "")
If tstestList is Nothing Then
print "No manual tests present", vbOK
Else
For i = 1 to tstestList.Count
Set temp = tstestList.Item(i)
if temp.TestSetFolder.father.name = strMonth then
qcconnection.TSTestFactory.RemoveItem(temp.id)
end if
Next
End If

It seems you use a wrong factory - you need to use TestSetFactory instead of TSTestFactory

Related

Proximity prompt an image label change visible not working

I'm trying to make it so that when you use a proximity prompt an image label becomes visible but it's not working, how do I fix this?
local proximity = workspace.Cardpack.ProximityPrompt
local proximityPromptService = game.GetService("ProximityPromptService")
proximity.Triggered:Connect(function()
_G.visible = not _G.visible game.Workspace.Inventory.Frame.X1.Visble = _G.visible
end)
You don't really need to use _G for this. Instead, we can directly declare it to the X1.
local prompt = workspace.Cardpack.ProximityPrompt
local x1 = workspace.Inventory.Frame.X1
prompt.Triggered:Connect(function()
x1.Visible = not x1.Visible
end)
_G.visible = not _G.visible game.Workspace.Inventory.Frame.X1.Visble = _G.visible
This is where your script goes entirely wrong. This is not LUA syntax and is not how programming works. This is actually what you are currently trying to do.
local value = true = false;
Really what you should be doing is creating a reference to the ImageLabel you are trying to set. Then change it's properties. Setting a variable in the global enviroment won't change the ImageLabel's properties.
local ProximityPromptService = game.GetService("ProximityPromptService");
local ImageLabel = workspace.Inventory.Frame.X1;
local Proximity = workspace.Cardpack.ProximityPrompt;
proximity.Triggered:Connect(function()
ImageLabel.Visible = true;
end)
This seems to be a simple issue which can be solved with a simple solution (granted you know what you're doing). Now here's some things to note:
You don't need to use the ;'s you see on almost every line people make. It's not something mandatory and shouldn't be. Though it's good for when you want to have less lines (if it's your preference).
You wouldn't want to have 2 ='s on the same line as it's not the correct syntax (as #sl0th has stated), you cannot attempt such a task as it wouldn't even work. You want it to not just change it back to false anyways.
As you code this, I don't believe you fully understand how it works, and to make the code you first of all have to understand COMPLETELY or rather fluently how it works. So let's start off with that!
How do we do this? Let's see:
-- Perhaps put the script INSIDE of the Cardpack, and then do it from here.
-- Also, I'm not sure why you've put an "inventory.Frame" here, if it's a screengui then it should go in StarterGui, however if it's a billboardgui then please ignore me.
local Cardpack = script.Parent -- I've added it inside the cardpack as said.
local Prompt = Cardpack.ProximityPrompt
local Label = workspace.Inventory.Frame.X1 -- using the original directory as I don't know how your explorer looks.
local CanBeVisible = false -- if you want to toggle it.
Prompt.Triggered:Connect(function() -- make sure to look up on devforum about this.
if not CanbeVisible then -- "not CanBeVisible" is equivalent to "CanBeVisible==false".
CanBeVisible = true
Label.Visible = true
else -- if it's true and not false:
CanBeVisible = false
Label.Visible = false
end
end)
This is a more..."Acceptable" way of coding. People have their preferences, but this is generally how I'd do it based on how you did it. IF you don't understand much I'm always here to help, of course! :D
FINAL NOTES:
local A,B = "A", "B" -- you can assign multiple variables on a single line!
A,B = "B", "A" -- and you can also change more than one on the same line too.
local A = "A";print(A) -- that's how ; is used if you want to do more than one thing on the same line (but not done at the the same time on the same line!). ; Seperates the code without needing to add spaces, though adding/casting variables you should stick to using the comma(s) to separate them assigning new values and whatnot.
Also, you don't even need that ProximityPromptService variable as you never even use it! And you can't just do game.GetService(..), you IDEALLY do it as game:GetService(..).
I hope this helped you and if it did, mark this as the answer! Though this is my first time trying to help people I tried my best lol.

Reading REG_QWORD with VBScript?

I think the question speaks for itself. I have trouble getting some values out of the registry, and I was hoping someone around here might help me.
I'm stuck at IE9, as it is the only one which has some reasonable CSS capabilities, and does support GetObject().
So right now, lets say I'm trying to retrieve the memory size of a GPU at "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000\HardwareInformation.qwMemorySize" (as far as I know, this should be a universal path & key).
This is where the problem begins. Either I get no output, or some error saying something is different, or what (my system is running in a different language so I cant offer the right translation).
After some research, I seem to have found the issue - the value I'm trying to read is REG_QWORD, and unfortunately I was only able to find very little covering this topic, and most of the solutions did not work for me.
So right now, I am with this code, which, unsurprisingly, also does not work (the code I had since like the beginning):
for Each oItem in colGPUs
memory = oItem.AdapterRAM / 1048576
If memory < 0 Then
If InStr(oItem.Name, "NVIDIA") Then
Set wssx = CreateObject("WScript.Shell")
msgbox CStr(wssx.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\000" + GPUID + "\HardwareInformation.qwMemorySize"))
End If
End If
Unfortunatelly it seems like there is no direct way of retrieving the value - within HTA itself.
I was able to get the value, however I did it using Powershell, executed the command, set its output to a specific file and read it.
Anyways, here is the actual solution I came up with specifically for this issue
wshell.Run "powershell (Get-ItemPropertyValue 'HKLM:\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000' 'HardwareInformation.qwMemorySize') | Out-File -FilePath C:\temp\gpu_mem.txt", 0, true
Set f = fso.OpenTextFile("C:\temp\gpu_mem.txt", 1, False, -1)
gpu_mem = CStr(f.ReadAll)
With this method Im directly obtaining the integer and passing it to the VBS

SAS Enterprise Guide with VBScript. Looping through SAS programs get stuck

I'm facing a random problem. When executing SAS programs with VBScript and the SASEGObjectModel.Application.7.1, looping through CodeCollection get stuck sometimes, even if the program execution was succeeded (the final data bases are correctly created in our server). The script simple doesn't go to the next program of CodeCollection (the prompt executing the script still open... ad infinitum). The SAS program It happens is random, also the frequency. I'm going with something like this:
Dim oSasApp
Set oSasApp = CreateObject("SASEGObjectModel.Application.7.1")
oSasApp.SetActiveProfile("some-profile")
Dim oSasProj
Set oSasProj = oSasApp.Open("some-project.egp", "")
Dim oProgramList
Set oProgramList = oSasProj.CodeCollection
Dim programOrder
Set programOrder = ...here I assign the SAS programs order array reading from a .txt...
For Each program in programOrder
For Each sasProgram in oProgramList
If sasProgram.Name = program Then
sasProgram.Run
sasProgram.Log.SaveAs "some-folder/" & sasProgram.Name & ".txt"
End If
Next
Next
oSasProj.Close
oSasApp.Quit
The problem is not the Log saving, as the log txt file of the stucked program is also correctly created.
Any idea? Maybe problems in our SAS server? Should I declare some kind of options?
SAS Guide version: 7.15
Windows: 10
Tks
So... for people facing the same problem. As I commented above, if I press enter on prompt the script flows again. So it is waiting for my input, for reasons I can't tell. I did 2 things to get around it. Not sure if all of them are necessary or if only one solves it, but here it goes:
First, by VBScript I turned off a list of generations and I applied a delay after the SAS program runs:
For Each program in programOrder
For Each sasProgram i oProgramList
If sasProgram.Name = program Then
sasProgram.GenSasReport = False
sasProgram.GenHTML = False
sasProgram.GenListing = False
sasProgram.GenPDF = False
sasProgram.GenRTF = False
sasProgram.Run
WScript.Sleep(2000)
sasProgram.Log.SaveAs "some-folder/" & sasProgram.Name & ".txt"
End If
Next
Next
Them, in my batch file, wich I use to call the VBScript with the "cscript" command, I set it to apply "y" to every single message the VBScript could ask:
cd ./script-folder
echo y | cscript script-file-name.vbs
And that is it.

VBScript Nothing returns garbage

We have to use VBScript as an embedded script engine in our Hospital Information System.
When we use nothing to set the value of a control (textbox/checkbox/...) it worked always fine. Since somepoint it sets now the textbox to "?>".
item("TEXTBOX").value = nothing ' Leads to -> "?>"
It is not completly clear what causes this, maybe a windows update is responsible, every rollup ~ since KB3212646 Win7 2017-01 seems to cause this error.
My Question is now, has someone else also seem this error, so that it is clear that MS causes this error or is our HIS publisher responsible for not handling nothing correct.
I know setting a textbox to Nothing is not best practice instead "" should be better, but since the item object could be more the just a textbox e.g. a combobox/checkbox this seems, from an objectoriented perpsective, better. Or am I completly wrong?
Following #Ansgar comment, you should apparently change everywhere you have = nothing to = "" in your example
item("TEXTBOX").value = ""
Beware to keep the nothing if you have the Set keyword in left
Set some_object = Nothing

What is the proper syntax for ".Stop" method for "Schedule.Service"?

I have some tasks that need to be removed. Some users have installed Chrome under their own profile and the only way to remove it is to "nuke" it since it is not feasible to log in with their account and do the uninstall the proper way. The scheduled tasks have a user sid added to the end of the name, so I have to search for a task with "GoogleUpdate" in the string. When I remove a service, I like to stop the service, disable the service, then delete it. I want to do the same thing with the scheduled tasks. After a lot of scouring of the web, I have found the syntax to disable, delete and that works perfect, but not how to stop. I would prefer not to shell out and use schtasks since I have come this far with a 200 + line script using all VbScript.
Here is what I have so far. I need help figuring out the syntax for the ".Stop" method. If anyone has an example of the stop method, it would be much appreciated.
Set objTaskService = CreateObject("Schedule.Service")
Call objTaskService.Connect()
Set objTaskFolder = objTaskService.GetFolder("\")
Set colTasks = objTaskFolder.GetTasks(0)
For Each objTask In colTasks
With objTask
If InStr(.Name, "GoogleUpdate") Then
objTask.Stop() << Wrong number of args or invalid property assignment
WScript.Sleep(10000)
objTask.Enabled = False << Working properly
objTaskFolder.DeleteTask objTask.Name,0 << Working properly
End If
End With
Next
The official documentation is located here: https://msdn.microsoft.com/en-us/library/windows/desktop/aa382098(v=vs.85).aspx
RegisteredTask.Stop(ByVal flags)
Parameters
flags [in]
Reserved.
Must be zero.
Hence, it should be
objTask.Stop 0

Resources