Hello,
I am trying to automate desktop application which is having web based login. URL of the login window changes daily.
I have app folder in repo-> LoginWindow- /dom[@domain='euw1-23qna11002-iam.3dx-staging.3ds.com']
and element1 -> User Name - //div[#'inner']/?/?/form[@action='https://euw1-23qna11002-iam.3dx-staging ... Metadata_0']/fieldset/div[3]/?/?/input[@name='username']
element2 -> Password - //div[#'inner']/?/?/form[@action='https://euw1-23qna11002-iam.3dx-staging ... Metadata_0']/fieldset/div[4]/?/?/input[@name='password']
element3 -.Submit -
Question - As Urls' of element1 and element2 changes daily I want to search the element in the app folder(LoginWindow)
like txtUserName = LoginWindow.FindElement(input[@name='username']) or txtPassword = LoginWindow.FindElement(input[@name='password'])
and set the values txtUserName.SendKeys("abc")
I created 2 tickets at Ranorex support but no reply from them.
Can some someone help me?
Thanks,
Pawan
Search element in App Folder
Search element in App Folder
- Attachments
-
- LoginWindow.rxsnp
- (82.33 KiB) Downloaded 8 times
Re: Search element in App Folder
Hi,
Why don't you use class attribute, instead of action attribute? It seems to be filled with reasonable and what appears to be static information? So you can use xpaths like these..
//div[#'inner']/?/?/form[@class~'uwa-input-form login-form']//input[@name='username']
//div[#'inner']/?/?/form[@class~'uwa-input-form login-form']//input[@name='password']
Ideally, create a root folder under DOM element, containing just this part of xpath...
//div[#'inner']/?/?/form[@class~'uwa-input-form login-form']
And inside create two input repo elements for username and password. Then simply pass repo elements to code via method parameters.
Why don't you use class attribute, instead of action attribute? It seems to be filled with reasonable and what appears to be static information? So you can use xpaths like these..
//div[#'inner']/?/?/form[@class~'uwa-input-form login-form']//input[@name='username']
//div[#'inner']/?/?/form[@class~'uwa-input-form login-form']//input[@name='password']
Ideally, create a root folder under DOM element, containing just this part of xpath...
//div[#'inner']/?/?/form[@class~'uwa-input-form login-form']
And inside create two input repo elements for username and password. Then simply pass repo elements to code via method parameters.
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
Re: Search element in App Folder
It's working, Thanks a lotodklizec wrote: ↑Fri Nov 13, 2020 8:12 amHi,
Why don't you use class attribute, instead of action attribute? It seems to be filled with reasonable and what appears to be static information? So you can use xpaths like these..
//div[#'inner']/?/?/form[@class~'uwa-input-form login-form']//input[@name='username']
//div[#'inner']/?/?/form[@class~'uwa-input-form login-form']//input[@name='password']
Ideally, create a root folder under DOM element, containing just this part of xpath...
//div[#'inner']/?/?/form[@class~'uwa-input-form login-form']
And inside create two input repo elements for username and password. Then simply pass repo elements to code via method parameters.
