Pass parameter vale in Aliases?
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Pass parameter vale in Aliases?
Hi,
I am trying to pass the value through parameter in Aliases but its throwing runtime error. Please help
function FXConnectRFSClientAllin(Val)
{
var intValue= Aliases.jp2launcher.JideSystemShell.Orders.exec_orders.RootPane.null_layeredPane.null_contentPane.SessionDetailsTabbedPanel.Panel.JideTabbedPane.BusyComponent.JXLayer.MultiOrderCardPanel.RFS_Competitive.JS_RFSOrderDetails.wValue(Val)
return intValue
}
Value i am passing is '0,15'
A
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try using that alias outside the function to assign a variable value and hard code the value in. That will help narrow down the issue.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, first of all, everything I'm saying after this sentence is based upon guess.
My GUESS... is that you're using a JavaScript project. In the JavaScript implementation in TestComplete, there are limitations on operating on properties that are accessed via index, like wValue in your code example. In these situations you need to use $set and $get to work with properties that have indices.
Change your code to the following:
function FXConnectRFSClientAllin(Val) { var intValue= Aliases.jp2launcher.JideSystemShell.Orders.exec_orders.RootPane.null_layeredPane.null_contentPane.SessionDetailsTabbedPanel.Panel.JideTabbedPane.BusyComponent.JXLayer.MultiOrderCardPanel.RFS_Competitive.JS_RFSOrderDetails.$get('wValue', Val) return intValue }
One other item of note... you might want to redo your Aliases. There are a lot of aliases in your string that appear to be just place holders in the hierarchy. If you're not interacting directly with "null_layeredPane", it doesn't need to have an Alias. It is probably mapped and that can remain, but you might want to look at "compressing" your Aliases into more usable strings. See https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/over...
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess 0,15 is row and column number to get value using wValue(row,column) method.
If i assume correctly, then you have to pass two parameters in order to get the value, as like below.
function FXConnectRFSClientAllin(rowValue,ColValue) { var intValue= Aliases.jp2launcher.JideSystemShell.Orders.exec_orders.RootPane.null_layeredPane.null_contentPane.SessionDetailsTabbedPanel.Panel.JideTabbedPane.BusyComponent.JXLayer.MultiOrderCardPanel.RFS_Competitive.JS_RFSOrderDetails.wValue(rowValue,ColValue); return intValue }
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tried this but still getting the runtime error as 'Type mismatch'
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you post a screenshot where you are getting type mismatch error?
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Type Mismatch error show me that, you have convert your string to int.
try like below,
function FXConnectRFSClientAllin(rowValue, ColValue) { try { rowValue = aqConvert.VarToInt(rowValue); ColValue = aqConvert.VarToInt(ColValue); } catch (ex) { Log.Error("Invalid inputs"); return; } var intValue = Aliases.jp2launcher.JideSystemShell.Orders.exec_orders.RootPane.null_layeredPane.null_contentPane.SessionDetailsTabbedPanel.Panel.JideTabbedPane.BusyComponent.JXLayer.MultiOrderCardPanel.RFS_Competitive.JS_RFSOrderDetails.wValue(rowValue, ColValue); return intValue }
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you were passing both row and column as a single parameter, right there is your problem. If wValue takes two parameters, you need to pass it two parameters, specifically, two integers. @shankar_r's code is the correct code, you need to make sure that you are passing the correct number of parameters.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
