Get Value not working as stated in User Guide

Ask general questions here.
zoework
Posts: 38
Joined: Tue Jan 27, 2015 10:44 pm
Location: Charlotte, NC, USA

Get Value not working as stated in User Guide

Post by zoework » Fri Apr 10, 2015 8:36 pm

I do not see any submenu when adding a Get Value action. The User Guide shows submenus for Invoke Action, Get Value and Set Value. Why can I not see it?
Attached is a snapshot of what my drop-down menu looks like.
Attachments
Ranorex_GetValue.jpg
Ranorex_GetValue.jpg (56.21 KiB) Viewed 919 times
Thanks,
Zoë (aka zoework)

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Get Value not working as stated in User Guide

Post by krstcs » Fri Apr 10, 2015 9:12 pm

There are no sub-menus for Get/Set Value or Invoke Actions when selected from the "Add New Action" drop-down, as you demonstrate in your screen-capture.

There are sub-menus for each of them when dragging a repository object into the action table, however, so maybe that is where the confusion is?
Shortcuts usually aren't...

zoework
Posts: 38
Joined: Tue Jan 27, 2015 10:44 pm
Location: Charlotte, NC, USA

Re: Get Value not working as stated in User Guide

Post by zoework » Fri Apr 10, 2015 9:40 pm

Thank you, but I think the User Guide is not very clear on this point.

I've dragged the repo item into my script, but the only available attribute is Custom. When I add the Custom Get Value with a regular expression to get the innertext, it is still not working. Here is a snippet from the log:
00:04.085 Info Get Value

Getting attribute 'Custom' from item 'QA_investor.HoldingsTable.SymText' and assigning the part of its value captured by '^@innertext=([A-Z]*)$' to variable 'SymbolText'.
00:04.335 Info User

(null)


(null) is from a Report Log statement.

My item definition looks like this:
/dom[@domain='mydomain']/body/?/?/div[@id='pageContainer']//div[@id='main-holdings']/div[@class='tableModuleContent portlet-content']/table[@id='holdingsTable']/tbody/tr[1]/td[1]/*[@enabled='True']
Thanks,
Zoë (aka zoework)

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3914
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Get Value not working as stated in User Guide

Post by odklizec » Mon Apr 13, 2015 8:51 am

Hi,

Could you please post a screenshot of recording line with your definition of GetValue (or code behind this line)?

If there is no InnerText attribute offered in GetValue submenu, then the GetValue action cannot obtain InnerText value! Have you tried to inspect the element with Spy? Is there InnerText displayed in Spy?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

zoework
Posts: 38
Joined: Tue Jan 27, 2015 10:44 pm
Location: Charlotte, NC, USA

Re: Get Value not working as stated in User Guide

Post by zoework » Mon Apr 13, 2015 3:02 pm

Not sure what you mean by 'recording line' as I inserted this action manually. The code behind GetValue looks like this:
Report.Log(ReportLevel.Info, "Get Value", "Getting attribute 'Name' from item 'QA_investor.HoldingsTable.SymbolInnertext' and assigning the part of its value captured by '^@innertext=([A-Z]*)$' to variable 'SymbolText'.", repo.QA_investor.HoldingsTable.SymbolInnertextInfo, new RecordItemIndex(7));
SymbolText = repo.QA_investor.HoldingsTable.SymbolInnertext.Element.GetAttributeValueText("Name", new Regex("^@innertext=([A-Z]*)$"));
Delay.Milliseconds(0);


The item does have an InnerText attribute that I can see in Spy. I cannot select this attribute as part of the item definition because it is dynamic. Hence the GetValue statement.
Thanks,
Zoë (aka zoework)

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3914
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Get Value not working as stated in User Guide

Post by odklizec » Mon Apr 13, 2015 3:28 pm

Hi,

What I mean is to show us a screenshot of your actual recording, where we can see the GetValue definition. It should look like this...
InnerText.png
InnerText.png (23.51 KiB) Viewed 888 times
Looking at code behind your GetValue action, it seems to me that you tried to use the @InnerText attribute as a part of RegEx? This is, in my opinion, incorrect. InnerText should be used in the Name parameter of Get Value action, as shown in my screenshot. Hope this helps?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

zoework
Posts: 38
Joined: Tue Jan 27, 2015 10:44 pm
Location: Charlotte, NC, USA

Re: Get Value not working as stated in User Guide

Post by zoework » Thu Apr 16, 2015 8:40 pm

Here is a snapshot of the recording and also one of the item in Spy. It is still not working. :x
Attachments
InnerTextSpy.JPG
Spy showing the InnerText attribute
InnerTextSpy.JPG (41.25 KiB) Viewed 866 times
InnerTextRecording.JPG
Statement in script
InnerTextRecording.JPG (18.33 KiB) Viewed 866 times
Thanks,
Zoë (aka zoework)

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3914
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Get Value not working as stated in User Guide

Post by odklizec » Thu Apr 16, 2015 9:29 pm

Try to use the expression without $ sign.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

zoework
Posts: 38
Joined: Tue Jan 27, 2015 10:44 pm
Location: Charlotte, NC, USA

Re: Get Value not working as stated in User Guide

Post by zoework » Thu Apr 16, 2015 9:38 pm

Eureka!!
:lol: :lol: :lol: :lol: :P
Thanks,
Zoë (aka zoework)