Is it possible to set the OPT_TRUELOG_SCREENSHOT_MODE value during a Silk4Net test with Visual Studio C#?
Is it possible to set the OPT_TRUELOG_SCREENSHOT_MODE value during a Silk4Net test with Visual Studio C#?
i have developed scripts on IE browser. using Silk Test Classic-Open agent(16.5 version)
i need to be run same scripts on Firefox and chrome browsers respectively.
Please suggest/ provide me samples codes for this.
the asset is locked by myself on my machine , how can i unlock it , just giving read-only access
Thank you in advance
Hi,
I have an issue with the string comparison when one of the string is of multiple lines.
Dim sExpectedData As String = "File numbers 1 to 5 of allocation (5 Files in Group)"
Dim sObjLoc As String = "/WPFWindow[@caption='ESS-MIREC']//WPFTextBlock[@automationId='FileViewDescription']"
Dim sActualData As String = _desktop.WPFTextBlock(sObjLocator).Text
The sActualData would be retrieved in the below form from the application under test:
File numbers 1 to 5 of allocation
(5 Files in Group)
I have tried to remove the unwanted spaces and breaks from this string using the below code:
sActualData = Trim(ReplacesActualData, vbLf, ""))
sActualData = Trim(ReplacesActualData, vbCrLf, ""))
When I compare now sExpectedData and sActualData, I would expect both to be same but it's not. The text is same in both but the count differs in both the strings (56 and 57 respectively).
Console.WriteLine(sExpectedData)
Console.WriteLine(sActualData )
Console.WriteLine(sExpectedData.Count)
Console.WriteLine(sActualData .Count)
OutPut:
File numbers 1 to 5 of allocation (5 Files in Group)
File numbers 1 to 5 of allocation (5 Files in Group)
56
57
Though I have replaced the blank space and line breaks, how still it differs? Is there any other possibility to remove the unwanted spaces at line breaks?
Do anybody have documentation regarding creating locator paths to make the objects unique?
Silk Visual test, I have similar object in 2 web pages, Can we differentiate both the objects with 2 different names and locator paths?
Hey there!
I have a very strange problem that I am hoping you could help me with as I am at a complete loss as to why this is happening. Please help!
I didn't make a single change to the script or to the ActiveData file, and I get this error:
"The type initializer for 'Main' threw an exception."
So, here is the script. The part in bold/italics is the step that fails:
Imports System.Diagnostics
Imports SilkTest.Ntf.XBrowser
Imports System.IO
Public Module Main
Public _desktop As Desktop = Agent.Desktop,
applicationProcess As New Process(),
ieprocess As New Process(),
chromeprocess As New Process(),
psi As New ProcessStartInfo()
'ACTIVE DATA
Public args = New Dictionary(Of String, Object)(),
row As ActiveDataRow,
rowno As Integer,
data = Workbench.LoadActiveData("MyPri_InputFile")
Here is what my ActiveData looks like:
Hey there,
Here is my situation with the error "'Browser' is not declared. It may be inaccessible due to its protection level" I am getting:
I dug around the internet and saw nothing about best practices using this method. Script is very simple (line in bold italics is the problemline):
Imports System.Diagnostics
Imports SilkTest.Ntf.XBrowser
Imports System.IO
Public Module Main
Public _desktop As Desktop = Agent.Desktop,
applicationProcess As New Process(),
ieprocess As New Process(),
chromeprocess As New Process(),
psi As New ProcessStartInfo()
Public Sub Main
With _desktop.BrowserApplication()
.SetActive()
.Maximize()
With .BrowserWindow("@url='*website.com*'")
Call Exists()
End Sub
Public Sub Exists()
With _desktop.BrowserApplication()
With .BrowserWindow("@url='*website.com*'")
<steps here>
BrowserWindow.WaitForObject("//BrowserWindow[@url='https://website.com/clientportal/j_security_check']", 10000)
.DomTextField("//input[@name='securityAnswer1']").SetText("securityanswer")
.DomButton("//input[@id='continue']").DomClick
End Sub
So what do you think woul dbe the best way to handle this?
Hi all,
We are reviewing the release note of SilkTest verision 17. In the Resolved Issues section, there are two issues.
RPI 1102202 Internet Explorer 11 might become unresponsive during replay after applying the Microsoft Security Patch KB3093983
RPI 1103832 Silk Test 16.5 cannot properly record a web page on Internet Explorer 11.
Anyone know how can I get more information for these two issues. Example, the navigation steps on how to reproduce them.
Thank you,
1. I am trying to grab a text property of an object and send it to Excel spread sheet. Please let me know how do we do that in Silk Visual Test,
2. Also want to know how to write an If condition whether the Object exists or not in Silk Visual Test, Please let me know the Option
So, I have a sample of my script. What it does is collects and compares expected values from the spreadsheet to actual values from the website it is running against. We make the comparison, save it to an "ae_XXXXX" variable and then FileOutput() sub will collect all the variables and write them out comma delimited to a spreadsheet that is then reviewed by managers.
How do I pass more than 20 variables into the FileOutput() sub my adding them into the parentheticals?
EX:
Public Sub FileOutput(args, ae_policy1fullname, ae_policy1owner, ae_policy1address1, ae_policy1address2, ae_policy1phone, ae_policy1email, ae_policy1beneprimary, ae_policy1benecontingent, ae_policy1insurancepremium, ae_policy1paymentmethod, ae_policy1nextpremiumdate, ae_policy1bankname, ae_policy1payorname, ae_policy1accountnumber, ae_policy1policystatus, ae_revenuesharingtotal, ae_myrep1name, ae_myrep1rank, ae_myrep1addressphonefax, ae_myrep1email)
Imports System.Diagnostics
Imports SilkTest.Ntf.XBrowser
Imports System.IO
Public Module Main
Public _desktop As Desktop = Agent.Desktop,
applicationProcess As New Process(),
ieprocess As New Process(),
chromeprocess As New Process(),
psi As New ProcessStartInfo
Public datetimefilename As String = DateTime.Now.ToString("_MM-dd-yyyy_HHmmss"),
filename As String = "C:\Users\Public\Desktop\MyPri_OutputTest\Regr_Merge_" & datetimefilename & ".csv",
errorfilename As String = "C:\Users\Public\Desktop\MyPri_OutputTest\Regr_Merge_ErrorOutputFile_" & datetimefilename & ".txt"
'FileOutput() Variables
Public ae_policy1fullname As String,
ae_policy1owner As String,
ae_policy1address1 As String,
ae_policy1address2 As String,
ae_policy1phone As String,
ae_policy1email As String,
ae_policy1beneprimary As String,
ae_policy1benecontingent As String,
ae_policy1insurancepremium As String,
ae_policy1paymentmethod As String,
ae_policy1nextpremiumdate As String,
ae_policy1bankname As String,
ae_policy1payorname As String,
ae_policy1accountnumber As String,
ae_policy1policystatus As String,
ae_revenuesharingtotal As String,
ae_myrep1name As String,
ae_myrep1rank As String,
ae_myrep1addressphonefax As String,
ae_myrep1email As String
Public Sub Main
Dim row As ActiveDataRow
Dim datetimefilename As String = DateTime.Now.ToString("_MM-dd-yyyy_HHmmss")
With _desktop.BrowserApplication()
.SetActive()
.Maximize()
With .BrowserWindow("@url='*.com*'")
For Each row In data
Try
rowno = row.RowNumber
...
'File Output Input Variables
args("myrep1name") = data.Item(rowno).GetString("myrep1name")
args("myrep1rank") = data.Item(rowno).GetString("myrep1rank")
args("myrep1addressphonefax") = data.Item(rowno).GetString("myrep1addressphonefax")
args("myrep1email") = data.Item(rowno).GetString("myrep1email")
args("policy1fullname") = data.Item(rowno).GetString("policy1fullname")
args("policy1fullnamecount") = data.Item(rowno).GetString("policy1fullnamecount")
args("policy1owner") = data.Item(rowno).GetString("policy1owner")
args("policy1ownercount") = data.Item(rowno).GetString("policy1ownercount")
args("policy1address1") = data.Item(rowno).GetString("policy1address1")
args("policy1address1count") = data.Item(rowno).GetString("policy1address1count")
args("policy1address2") = data.Item(rowno).GetString("policy1address2")
args("policy1address2count") = data.Item(rowno).GetString("policy1address2count")
args("policy1phone") = data.Item(rowno).GetString("policy1phone")
args("policy1phonecount") = data.Item(rowno).GetString("policy1phonecount")
args("policy1email") = data.Item(rowno).GetString("policy1email")
args("policy1emailcount") = data.Item(rowno).GetString("policy1emailcount")
args("policy1beneprimary") = data.Item(rowno).GetString("policy1beneprimary")
args("policy1beneprimarycount") = data.Item(rowno).GetString("policy1beneprimarycount")
args("policy1benecontingent") = data.Item(rowno).GetString("policy1benecontingent")
args("policy1benecontingentcount") = data.Item(rowno).GetString("policy1benecontingentcount")
args("policy1insurancepremium") = data.Item(rowno).GetString("policy1insurancepremium")
args("policy1insurancepremiumcount") = data.Item(rowno).GetString("policy1insurancepremiumcount")
args("policy1paymentmethod") = data.Item(rowno).GetString("policy1paymentmethod")
args("policy1paymentmethodcount") = data.Item(rowno).GetString("policy1paymentmethodcount")
args("policy1nextpremiumdate") = data.Item(rowno).GetString("policy1nextpremiumdate")
args("policy1nextpremiumdatecount") = data.Item(rowno).GetString("policy1nextpremiumdatecount")
args("policy1bankname") = data.Item(rowno).GetString("policy1bankname")
args("policy1banknamecount") = data.Item(rowno).GetString("policy1banknamecount")
args("policy1payorname") = data.Item(rowno).GetString("policy1payorname")
args("policy1payornamecount") = data.Item(rowno).GetString("policy1payornamecount")
args("policy1accountnumber") = data.Item(rowno).GetString("policy1accountnumber")
args("policy1accountnumbercount") = data.Item(rowno).GetString("policy1accountnumbercount")
args("policy1policystatus") = data.Item(rowno).GetString("policy1policystatus")
args("policy1policystatuscount") = data.Item(rowno).GetString("policy1policystatuscount")
...
Call FileOutput(args, ae_policy1fullname, ae_policy1owner, ae_policy1address1, ae_policy1address2, ae_policy1phone, ae_policy1email, ae_policy1beneprimary, ae_policy1benecontingent, ae_policy1insurancepremium, ae_policy1paymentmethod, ae_policy1nextpremiumdate, ae_policy1bankname, ae_policy1payorname, ae_policy1accountnumber, ae_policy1policystatus, ae_revenuesharingtotal, ae_myrep1name, ae_myrep1rank, ae_myrep1addressphonefax, ae_myrep1email)
----
This is the bit that compares the actual and expected and spits out an "ae_XXXXX" variable that gets passed to FileOutput() sub:
'Rep First Name
If StrComp(.DomElement("//div[@id='main_content']/h2").GetText, args("myrep1name"), vbTextCompare) = 0 Then
ae_myrep1name = .DomElement("//div[@id='main_content']/h2").GetText & " | " & args("myrep1name") & " | P"
MsgBox (ae_myrep1name, MsgBoxStyle.MsgBoxSetForeground, "ae_myrep1name") 'Comment this in if you want the message box
Else
ae_myrep1name = .DomElement("//div[@id='main_content']/h2").GetText & " | " & args("myrep1name") & " | F"
MsgBox (ae_myrep1name, MsgBoxStyle.MsgBoxSetForeground, "ae_myrep1name") 'Comment this in if you want the message box
End If
----
This is the FileOutput() sub that collects all the "ae_XXXXX" variables and writes them out to a spreadsheet. The problem is, how do I collect more than 20?:
Public Sub FileOutput(args, ae_policy1fullname, ae_policy1owner, ae_policy1address1, ae_policy1address2, ae_policy1phone, ae_policy1email, ae_policy1beneprimary, ae_policy1benecontingent, ae_policy1insurancepremium, ae_policy1paymentmethod, ae_policy1nextpremiumdate, ae_policy1bankname, ae_policy1payorname, ae_policy1accountnumber, ae_policy1policystatus, ae_revenuesharingtotal, ae_myrep1name)
Dim filename As String = "C:\Users\Public\Desktop\MyPri_OutputTest\Regr_Merge_" & datetimefilename & ".csv"
Console.WriteLine("Start")
Console.WriteLine(ae_policy1fullname)
Console.WriteLine(ae_policy1owner)
Console.WriteLine(ae_policy1address1)
Console.WriteLine(ae_policy1address2)
Console.WriteLine(ae_policy1phone)
Console.WriteLine(ae_policy1email)
Console.WriteLine(ae_policy1beneprimary)
Console.WriteLine(ae_policy1benecontingent)
Console.WriteLine(ae_policy1insurancepremium)
Console.WriteLine(ae_policy1paymentmethod)
Console.WriteLine(ae_policy1nextpremiumdate)
Console.WriteLine(ae_policy1bankname)
Console.WriteLine(ae_policy1payorname)
Console.WriteLine(ae_policy1accountnumber)
Console.WriteLine(ae_policy1policystatus)
Console.WriteLine(ae_revenuesharingtotal)
Console.WriteLine(ae_myrep1name)
Console.WriteLine(ae_myrep1rank)
Console.WriteLine(ae_myrep1addressphonefax)
Console.WriteLine(ae_myrep1email)
Console.WriteLine("End")
If Not File.Exists(filename)
Using outputsw As StreamWriter = File.CreateText(filename)
outputsw.WriteLine("Test Case,First Name,Middle Name,Last Name,Policy 1 Full Name,Policy 1 Owner,Policy 1 Address 1,Policy 1 Address 2,Policy 1 Phone,Policy 1 Email,Policy 1 Beneficiaries,Policy 1 Insurance Premium,Policy 1 Payment Method,Policy 1 Next Premium Date,Policy 1 Bank Name,Policy 1 Payor Name,Policy 1 Account Number,Policy 1 Policy Status,Revenue Sharing Total,MyRep 1 Name,MyRep 1 Rank,MyRep 1 Address,MyRep 1 Email")
End Using
End If
Using outputsw As StreamWriter = File.AppendText(filename)
outputsw.WriteLine(args("testcase") & "," & args("firstname") & "," & args("midname") & "," & args("lastname") & "," & ae_policy1fullname & "," & ae_policy1owner & "," & ae_policy1address1 & "," & ae_policy1address2 & "," & ae_policy1phone & "," & ae_policy1email & "," & ae_policy1beneprimary & "," & ae_policy1benecontingent & "," & ae_policy1insurancepremium & "," & ae_policy1paymentmethod & "," & ae_policy1nextpremiumdate & "," & ae_policy1bankname & "," & ae_policy1payorname & "," & ae_policy1accountnumber & "," & ae_policy1policystatus & "," & ae_revenuesharingtotal & "," & ae_myrep1name & "," & ae_myrep1rank & "," & ae_myrep1addressphonefax & "," & ae_myrep1email)
End Using
End Sub 'FileOutput
I use silktest runtime to execute my scripts for regression.
I invoke runtime thru DOS prompt, Sometimes while invoking runtime i see a dialog saying "unable to open c:\xyz\abc.res".
So i want to clear the filelist before invoking runtime. Please let me know in which ini file the filelist gets stored for runtime.
Note: For ST the list is stored in partner.ini, wanna know which ini stores the information incase of runtime.
I have a question, when I click button, It continued so long time then do not next click, when page load over then click , it waste time, How can it Click then immediately do next click
Hi,
I am using Silk Test Workbench for automation. So far, I executed the automation script from Silk Test Workbench.
Now, I don't want to open Silk Test and run the scripts. Rather, want to run it without opening Silk Test.
Could you please help?
When i use methods like ScrollToMax/ScrollByLine, it creates white space in the app (win32). Any reason why it does so.
If i scroll manually i do not see the white space issue. It happens only if i use those silktest scroll methods.
Hi,
I am using Silk Test - Open Agent for a Desktop Application. Please help in accessing a Locator without using Index value.
Thanks in Advance!!
I am currently using Silktest Workbench 17.0. Is there any way to perform a search of your entire Project for specific code? For example, let's say I created a function called getAlarms. A bunch of time has gone by and I've written many scripts with extensive amounts of code. Now I am working with alarms again and I know I created a function related to them. I want to be able to search all the code in my Project for getAlarms. Or maybe I forget the function name but I know the comment would mention "alarm" so I want to search for that. Short of going to each .NET script individually and performing a search, is there a way to do a global search? I don't believe that there is, but I'm hoping someone has maybe figured out a way to do this.
Thanks.