Hey guys,
i need to read out the text which is seen in the screenshot and safe this in a variable.
Is there a way how i can do that ?
this is the xpath to the element:
.//container[@name='OptionPane.realBody']/container[@name='OptionPane.body']/text[@caption~'^A\ job\ with\ the\ ID\ ''1948''\ ']
regards
patrick
How to read out values from textbox
How to read out values from textbox
- Attachments
-
- 2017-06-21_13h25_01.png (8.2 KiB) Viewed 1649 times
Re: How to read out values from textbox
Hi,
Please upload a Ranorex snapshot (not screenshot) of the mentioned message box.
Basically, it should be enough to use GetValue action for element stored in repo with this xpath:
Without seeing the snapshot, it's hard to tell if the xpath is unique. So try the above xpath, if it uniquely identifies the text element.
Please upload a Ranorex snapshot (not screenshot) of the mentioned message box.
Basically, it should be enough to use GetValue action for element stored in repo with this xpath:
Code: Select all
.//container[@name='OptionPane.realBody']/container[@name='OptionPane.body']/text
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
-
- Posts: 254
- Joined: Tue Mar 24, 2015 5:05 pm
- Location: Des Moines, Iowa, USA
Re: How to read out values from textbox
Before we get too far into this you should clarify what you're trying to accomplish. Are you trying to validate that a specific text exists or are you trying to identify an object based on specific text.
If you're trying to validate the specific text, you should NOT use that specific text as an attribute in the RxPath. Otherwise rather than getting a validation failure you'll get an object identification failure.
If you're just trying to capture the text for comparison later, I still wouldn't use the specific text in the RxPath because you may run into that same object ID failure again. If you provide a snapshot, we can assist in developing an appropriate RxPath to get you what you need.
Second the "getValue" action as odklizec mentions is appropriate. You'll want to create a module variable to store the value and you'll need to create a parameter in your test suite at some level in order to pass it on to other modules.
Please please please don't just capture the text and print it off in the report. the purpose of automation is defeated when someone has to physically review a report to validate something that could be asserted in text. I see novice users in my organization do this all the time and it drives me crazy.
If you're trying to validate the specific text, you should NOT use that specific text as an attribute in the RxPath. Otherwise rather than getting a validation failure you'll get an object identification failure.
If you're just trying to capture the text for comparison later, I still wouldn't use the specific text in the RxPath because you may run into that same object ID failure again. If you provide a snapshot, we can assist in developing an appropriate RxPath to get you what you need.
Second the "getValue" action as odklizec mentions is appropriate. You'll want to create a module variable to store the value and you'll need to create a parameter in your test suite at some level in order to pass it on to other modules.
Please please please don't just capture the text and print it off in the report. the purpose of automation is defeated when someone has to physically review a report to validate something that could be asserted in text. I see novice users in my organization do this all the time and it drives me crazy.
Doug Vaughan
Re: How to read out values from textbox
i could solve the problem via the getValue method.
Thanks for your advice
Thanks for your advice