Hello!
I use version 5.2.2.21596.
I have an issue. I have WPF controls on 3 tabs.
Tab which default selected at start application has no problems with inspect the object.
However, other tabs with controls can't be identify.
I tried to change default checked tab and it works -> i can inspect all controls in this tab, but can't in others.
I try to add automationId, but it didn't help.
Any idea how to help me? I want to use your tool for my current project.
Update: add snapshot.
Find only element of default tab
-
- Posts: 19
- Joined: Tue Jan 27, 2015 4:09 pm
Find only element of default tab
You do not have the required permissions to view the files attached to this post.
Re: Find only element of default tab
First, please provide more information. You didn't give us the XPath to the element(s) in question, that would be helpful.
Second, for most tab-pages you need to click the tab before Ranorex will be able to identify and take action against elements on the corresponding tab-page. Try adding a Click action on the desired tab before trying to find or take actions on the elements.
Second, for most tab-pages you need to click the tab before Ranorex will be able to identify and take action against elements on the corresponding tab-page. Try adding a Click action on the desired tab before trying to find or take actions on the elements.
Shortcuts usually aren't...
-
- Posts: 19
- Joined: Tue Jan 27, 2015 4:09 pm
Re: Find only element of default tab
Select tab:
Click button
Its for example. All tabPages have automationId. Sure, i click on it before i want to click element.
When the for is default i don't have any problems with click element.
When i try to track non default tab Ranorex spy highlights all of the parent element, not the current tab.
If you need i can provide more info. Any questions. Thank you for your help!
Code: Select all
TabPage tabInsert = form.FindSingle<Ranorex.TabPage>(".//tabpage[@automationid='InsertId']");
tabInsert.Click();
Code: Select all
Button LoopBtn = form.FindSingle<Ranorex.Button>(".//button[@automationid='ValueId']");
LoopBtn.Click();
When the for is default i don't have any problems with click element.
When i try to track non default tab Ranorex spy highlights all of the parent element, not the current tab.
If you need i can provide more info. Any questions. Thank you for your help!
Re: Find only element of default tab
I'm not sure I understand the issue.
Are you getting an error when you attempt to click on the element after clicking the tab?
As I said, Ranorex generally has problems identifying child elements of tab-pages that aren't visible because Windows does not draw them until the tab is clicked.
Try this in your test:
Click the tab.
Validate that the element in question is visible.
Then try to click the element in question.
Are you getting an error when you attempt to click on the element after clicking the tab?
As I said, Ranorex generally has problems identifying child elements of tab-pages that aren't visible because Windows does not draw them until the tab is clicked.
Try this in your test:
Click the tab.
Validate that the element in question is visible.
Then try to click the element in question.
Shortcuts usually aren't...
Re: Find only element of default tab
It *could* also be that the element with the same AutomationID lives on multiple tabs (the XPath is different because of where it lives, but the element AutomationID is identical). Therefore when the AUT is first started and the first Tab is displayed the element exists on that tab. When the new tab is opened, the element for that tab exists (but the original element on the initial tab still exists, and is marked as not visible). If this is the case, then running a FindSingle from the root form is finding the original element and not the element that was drawn second on the second tab.
If this is the issue, you can solve by either rooting your FindSingle at the Tab level or add a visible check to your FindSingle so that it only finds the element that is visible at this moment in time.
If this is the issue, you can solve by either rooting your FindSingle at the Tab level or add a visible check to your FindSingle so that it only finds the element that is visible at this moment in time.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
-
- Posts: 19
- Joined: Tue Jan 27, 2015 4:09 pm
Re: Find only element of default tab
Thank you for your posts!
Ciege, I try to find same automationId, but didn't find. I think i don't have same ids.
1_homeTab. It isn't select by default. Spy can't get access to any element here. (cursor is on the "B" ).
2_insertTab. It is select by default. Spy can get any element.
If i switch default tab to "home" (in source), i can get any element in this tab, but can't in "Insert" tab.
When i try to click to button on not default tab, ranorex can't find element on this tab. Sure, i switch to this tab before i am trying to click.
Visible = false.
Error after click on button.
And if this tab will default, this code will work, visible = try.
Ciege, I try to find same automationId, but didn't find. I think i don't have same ids.
There are screenshots in attach. I hope it helps you to understand.I'm not sure I understand the issue.
1_homeTab. It isn't select by default. Spy can't get access to any element here. (cursor is on the "B" ).
2_insertTab. It is select by default. Spy can get any element.
If i switch default tab to "home" (in source), i can get any element in this tab, but can't in "Insert" tab.
When i try to click to button on not default tab, ranorex can't find element on this tab. Sure, i switch to this tab before i am trying to click.
Click the tab.
Validate that the element in question is visible.
Code: Select all
TabPage tabInsert = form.FindSingle<Ranorex.TabPage>(".//tabpage[@automationid='InsertId']");
tabInsert.Select();
Button LoopBtn = form.FindSingle<Ranorex.Button>(".//button[@automationid='ValueId']");
Console.WriteLine(LoopBtn.Visible);
LoopBtn.Click();
Error after click on button.
And if this tab will default, this code will work, visible = try.
You do not have the required permissions to view the files attached to this post.
Re: Find only element of default tab
So you are showing us a screenshot of Word. Is the XSL function group your own Add In?
Can you please make a RanorexSpy snapshot of the AUT with the Home tab selected, then one with the Insert tab selected? (Since you don't show in your screenshots which button has the AutomationID of ValueId.
Can you post the EXACT error message you receive when Ranorex cannot find the button?
Try changing the following code from a .Select to a .Click:
Can you please make a RanorexSpy snapshot of the AUT with the Home tab selected, then one with the Insert tab selected? (Since you don't show in your screenshots which button has the AutomationID of ValueId.
Can you post the EXACT error message you receive when Ranorex cannot find the button?
Try changing the following code from a .Select to a .Click:
Code: Select all
tabInsert.Select();
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
-
- Posts: 19
- Joined: Tue Jan 27, 2015 4:09 pm
Re: Find only element of default tab
This application isn't Word. It only looks like Word. And i don't have this problem when i try to identify objects in Word.So you are showing us a screenshot of Word
I add 2 snapshots.
Element 'Visual Designer' -> Container 'Editor' -> TabPageList 'RadRichTextBoxRibbonUIID'
Here tabPages 'HomeId', 'InsertId' and some others.
Button Value has automationId = "ValueId".AutomationID of ValueId
All my buttons have similar names.
I did, it doesn't helpTry changing the following code from a .Select to a .Click:
Sure.Can you post the EXACT error message you receive when Ranorex cannot find the button?
Ranorex.ElementNotFoundException: No element found for path './/button[@automationid='ValueId']'.
at Ranorex.Core.Element.FindSingle(RxPath path)
at Ranorex.Adapter.FindSingle[T](RxPath path)
at Try1.InsertValue.SecondTest() in <path>\insertValue.cs:line 41
PS helpdesk of Ranorex wrote me. They said that they try to fix this issue.
"The release of this new Ranorex Version will be in the next week"
I hope they can fix it!
You do not have the required permissions to view the files attached to this post.
Re: Find only element of default tab
They are pretty good about these things, so I too hope they get it for you...PS helpdesk of Ranorex wrote me. They said that they try to fix this issue.
"The release of this new Ranorex Version will be in the next week"
I hope they can fix it!
Regardless, I had a look at your snapshot with the Insert tab selected, and sure enough I can find the .//button[@automationid='ValueId'] element in RanorexSpy (which means Ranorex should be able to find it as well). Some things to check / try before Ranorex help desk gets back to you:
*) Add a delay after selecting the Insert Tab, just in case it takes some time for the tab to load or positively verify the tab has loaded before you begin your find
*) Root your search from 'tabInsert' instead of 'form' since you already have that element and so that Ranorex has less of a tree to look through
Code: Select all
Button LoopBtn = tabInsert.FindSingle<Ranorex.Button>(".//button[@automationid='ValueId']");
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
-
- Posts: 19
- Joined: Tue Jan 27, 2015 4:09 pm
Re: Find only element of default tab
Hello!
Thank you for your reply!
I wrote about it: in this snapshot you can find any elements in insert tab, but can't find any in other tabs.
Default selected tab is "Home". In this snapshot i can't find elements in insert tab.
I tried to do timers before Ranorex start search element but it doesn't help.
After i have error application doesn't close. In this time i try to use ranorex spy, but it can't find element.
I hope Ranorex 5.3 is coming soon.
Thank you for your reply!
I think you found it in " insert_defaultSelected.rxsnp"I had a look at your snapshot with the Insert tab selected, and sure enough I can find the .//button[@automationid='ValueId'] element in RanorexSpy
I wrote about it: in this snapshot you can find any elements in insert tab, but can't find any in other tabs.
Default selected tab is "Home". In this snapshot i can't find elements in insert tab.
I tried to do timers before Ranorex start search element but it doesn't help.
After i have error application doesn't close. In this time i try to use ranorex spy, but it can't find element.
I hope Ranorex 5.3 is coming soon.
-
- Posts: 19
- Joined: Tue Jan 27, 2015 4:09 pm
Re: Find only element of default tab
hello there
Ranorex 5.3 fix my problem.
Thank you all!
Ranorex 5.3 fix my problem.
Thank you all!