I am evaluating Ranorex 2.0 RC1 for my company.
I have problem with getting text field element. Application is written in Delphi
I always get ElementNotFoundException.
Code: Select all
try:
path = "/form[@title='Log On'and@processname='Builder'and@class='TLogInForm']"
loginForm = Ranorex.Host.Local.FindSingle[Ranorex.Form](path, self._timeout)
if not loginForm.Active:
try:
loginForm.Activate()
except Ranorex.ActionFailedException:
return False
except Ranorex.ElementNotFoundException:
return False
try:
path = "/element[@processname='Builder'and@class='TPanel'and@instance='0']
/element[@processname='Builder'and@class='TEdit'and@instance='0']
/text[@accessiblerole='Text']"
txtUsername = loginForm.FindSingle[Ranorex.Text](path, self._timeout)
except Ranorex.ElementNotFoundException:
return False
If I try this:
Code: Select all
path = Ranorex.Core.RxPath.Concat(loginForm.GetPath(), Ranorex.Core.RxPath("/element[@processname='Builder'and@class='TPanel'and@instance='0']
/element[@processname='Builder'and@class='TEdit'and@instance='0']
/text[@accessiblerole='Text']"))
txtUsername = Ranorex.Host.Local.FindSingle[Ranorex.Text](path, self._timeout)
Path is the same as the path in the Ranorex Spy.
Getting just /element[@processname='Builder'and@class='TPanel'and@instance='0'] doesn't work too, but with Ranorex.Host.Local it works.
Am I doing something wrong?