Identify elements from pane
Identify elements from pane
Hi Support,
Can you please tell me how to identify and click on links in provided snapshot ?
I am trying to identify path of one of available link as-
//table[#'FC_dgForecastProfileNavigationGrid']//td/a[@innertext='Histories']
But Sorry, Its wrong some where.
Thanks in advance,
Varun.
Can you please tell me how to identify and click on links in provided snapshot ?
I am trying to identify path of one of available link as-
//table[#'FC_dgForecastProfileNavigationGrid']//td/a[@innertext='Histories']
But Sorry, Its wrong some where.
Thanks in advance,
Varun.
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Identify elements from pane
Hi Varun,
Please check the value of the InnerText attribute with the Spy tool, then you will see that the InnerText is "8. Histories" and not "Histories", this is why Ranorex wasn't able to find the element, so please use one of the following RxPaths:
Regards,
Markus
Please check the value of the InnerText attribute with the Spy tool, then you will see that the InnerText is "8. Histories" and not "Histories", this is why Ranorex wasn't able to find the element, so please use one of the following RxPaths:
Code: Select all
//table[#'FC_dgForecastProfileNavigationGrid']//td/a[@innertext='8.Histories']//table[#'FC_dgForecastProfileNavigationGrid']//td/a[@innertext~'Histories']
Markus
Re: Identify elements from pane
Hi Markus,
Thanks for post reply. Actually I was looking to get required element without using numbering bullets.
This pane is visible in 11 web pages but if I have to click on any of its element from any other page then its not working. Working fine if play the script(of click on element) on that page from which recording was done. RX Spy too not able to identify element by same way.
Is there any way to identify common elements from any of web page ?
This practice is also important to us because we have to play our scripts on different servers having different URL's but having same application.
Hope I have cleared my doubt.
Thanks,
Varun.
Thanks for post reply. Actually I was looking to get required element without using numbering bullets.
This pane is visible in 11 web pages but if I have to click on any of its element from any other page then its not working. Working fine if play the script(of click on element) on that page from which recording was done. RX Spy too not able to identify element by same way.
Is there any way to identify common elements from any of web page ?
This practice is also important to us because we have to play our scripts on different servers having different URL's but having same application.
Hope I have cleared my doubt.
Thanks,
Varun.
Re: Identify elements from pane
Hi Markus,
Sorry, it should also be added in previous post. Click event not working for the pane, can you please elaborate where I am wrong in the following code -
I am using same pane for which RX snapshot is attached in first thread of this post.
Thanks in advance,
Varun.
Sorry, it should also be added in previous post. Click event not working for the pane, can you please elaborate where I am wrong in the following code -
Code: Select all
InputTag path = Host.Local.FindSingle("/dom[@domain='xeonserver1']//table[#'FC_dgForecastProfileNavigationGrid']//tr/td/a[@innertext~'Window Mapping']");
Report.Info("Trying to find path; " + path.GetPath().ToString());
path.Click();
Thanks in advance,
Varun.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Identify elements from pane
Hi,
The RxPath should work but you are searching for an ATag and not for an InputTag, so please use this code:
Regards,
Markus
The RxPath should work but you are searching for an ATag and not for an InputTag, so please use this code:
ATag path = Host.Local.FindSingle("/dom[@domain='xeonserver1']//table[#'FC_dgForecastProfileNavigationGrid']//tr/td/a[@innertext~'Window Mapping']"); Report.Info("Trying to find path; " + path.GetPath().ToString()); path.Click();, you have to make sure you declare the appropriate adapter type, when you are searching for an ATag you must also use an ATag adapter.
Regards,
Markus
Re: Identify elements from pane
Hi Markus,
Thank you for the information. It works now by replacing adapter.
I have a doubt regarding adapter, ATag ? What it's use and how many such adapters are there?
It will be great if you provide me with documents having such information on adapters ?
Thanks in advance,
Varun.
Thank you for the information. It works now by replacing adapter.
I have a doubt regarding adapter, ATag ? What it's use and how many such adapters are there?
It will be great if you provide me with documents having such information on adapters ?
Thanks in advance,
Varun.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Identify elements from pane
Hi,
For an overview of all adapters have a look at the inheritance hierarchy of the adapter class.
To get a better understanding of adapters, please have a look at the section "Ranorex UI Adapter" in our user guide.
Regards,
Tobias
Ranorex Team
To get more information about the ATag adapter please have a look at the API documentation of the ATag adapter.varun wrote:It will be great if you provide me with documents having such information on adapters ?
For an overview of all adapters have a look at the inheritance hierarchy of the adapter class.
To get a better understanding of adapters, please have a look at the section "Ranorex UI Adapter" in our user guide.
Regards,
Tobias
Ranorex Team
Re: Identify elements from pane
Hi Markus,
Thank you for the references.
One point remain unanswered from one of our posts regarding,
Thanks,
Varun.
Thank you for the references.
One point remain unanswered from one of our posts regarding,
As application is available on multiple servers but Script is running only on server on which it was recorded. And I have to run it on other servers too. So what needs to done for this ?varun wrote:This practice is also important to us because we have to play our scripts on different servers having different URL's but having same application.
Thanks,
Varun.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Identify elements from pane
Hi,
I would use an attribute which is environment independent, did you already analyzed the available attributes of the specific element with the Spy tool?
Is there an attribute which doesn't change, which remains the same on different servers?
Regards,
Markus
I would use an attribute which is environment independent, did you already analyzed the available attributes of the specific element with the Spy tool?
Is there an attribute which doesn't change, which remains the same on different servers?
Regards,
Markus
Re: Identify elements from pane
Hi Markus,
Yes I have checked the attributes and they remain same on different servers, only there path changes. For instance, please find link of some elements verified on 2 servers -
Add button on Server 1:
/dom[@domain='xeonserver1' and @caption='Forecast Profiles' and @page='ListForecastProfiles.aspx' and @path='/NextGenR22_QA/ListForecastProfiles.aspx']//input[#'btnAdd']
Add button on Server 2:
/dom[@domain='xeonserver1' and @caption='Forecast Profiles' and @page='ListForecastProfiles.aspx' and @path='/NextGenProfitOpt2012.1/ListForecastProfiles.aspx']//input[#'btnAdd']
Radion option on Server 1:
/dom[@domain='xeonserver1' and @caption='Maintain Resource' and @page='AddOrUpdateResource.aspx' and @path='/NextGenR22_QA/AddOrUpdateResource.aspx']//input[#'rblIsConstrained_1']
Radion option on Server 2:
/dom[@domain='xeonserver1' and @caption='Maintain Resource' and @page='AddOrUpdateResource.aspx' and @path='/NextGenProfitOpt2012.1/AddOrUpdateResource.aspx']//input[#'rblIsConstrained_1']
Thanks,
Varun.
Yes I have checked the attributes and they remain same on different servers, only there path changes. For instance, please find link of some elements verified on 2 servers -
Add button on Server 1:
/dom[@domain='xeonserver1' and @caption='Forecast Profiles' and @page='ListForecastProfiles.aspx' and @path='/NextGenR22_QA/ListForecastProfiles.aspx']//input[#'btnAdd']
Add button on Server 2:
/dom[@domain='xeonserver1' and @caption='Forecast Profiles' and @page='ListForecastProfiles.aspx' and @path='/NextGenProfitOpt2012.1/ListForecastProfiles.aspx']//input[#'btnAdd']
Radion option on Server 1:
/dom[@domain='xeonserver1' and @caption='Maintain Resource' and @page='AddOrUpdateResource.aspx' and @path='/NextGenR22_QA/AddOrUpdateResource.aspx']//input[#'rblIsConstrained_1']
Radion option on Server 2:
/dom[@domain='xeonserver1' and @caption='Maintain Resource' and @page='AddOrUpdateResource.aspx' and @path='/NextGenProfitOpt2012.1/AddOrUpdateResource.aspx']//input[#'rblIsConstrained_1']
Thanks,
Varun.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Identify elements from pane
Hi Varun,
You could for instance use the following RxPath:
for more detailes about the RxPath please take a look at the following links:
RanoreXPath
RanoreXPath – Tips and Tricks
Regards,
Markus
You could for instance use the following RxPath:
Code: Select all
/dom[@domain='xeonserver1' and @caption='Forecast Profiles' or @caption='Maintain Resource']
RanoreXPath
RanoreXPath – Tips and Tricks
Regards,
Markus
Re: Identify elements from pane
Hi Markus,
I think you take it in a wrong way. Let me clear this point with only one example.
If we talk about Add button of a page on 2 servers, say xeonserver1/NextGenR22_QA as Server 1 and xeonserver1/NextGenProfitOpt2012.1 as Server 2.
On analyzing Add button with Spy, it's observed that attributes remain same. Following are its Spy path on 2 different servers-
Server 1:
/dom[@domain='xeonserver1' and @caption='Forecast Profiles' and @page='ListForecastProfiles.aspx' and @path='/NextGenR22_QA/ListForecastProfiles.aspx']//input[#'btnAdd']
Server 2:
/dom[@domain='xeonserver1' and @caption='Forecast Profiles' and @page='ListForecastProfiles.aspx' and @path='/NextGenProfitOpt2012.1/ListForecastProfiles.aspx']//input[#'btnAdd']
Change is only in path(see red font above) of element. I already designed most of my Test Cases, so is there a way to play recorded Test Cases independent of Server/URL of application?
Thanks,
Varun.
I think you take it in a wrong way. Let me clear this point with only one example.
If we talk about Add button of a page on 2 servers, say xeonserver1/NextGenR22_QA as Server 1 and xeonserver1/NextGenProfitOpt2012.1 as Server 2.
On analyzing Add button with Spy, it's observed that attributes remain same. Following are its Spy path on 2 different servers-
Server 1:
/dom[@domain='xeonserver1' and @caption='Forecast Profiles' and @page='ListForecastProfiles.aspx' and @path='/NextGenR22_QA/ListForecastProfiles.aspx']//input[#'btnAdd']
Server 2:
/dom[@domain='xeonserver1' and @caption='Forecast Profiles' and @page='ListForecastProfiles.aspx' and @path='/NextGenProfitOpt2012.1/ListForecastProfiles.aspx']//input[#'btnAdd']
Change is only in path(see red font above) of element. I already designed most of my Test Cases, so is there a way to play recorded Test Cases independent of Server/URL of application?
Thanks,
Varun.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Identify elements from pane
Hi Varun,
You could for instance delete it, for new records you could decrease the path weight for the "path" attribute in the Path Weights Editor of the Spy tool.
For more information please take a look at the attached screenshot: Regards,
Markus
You could for instance delete it, for new records you could decrease the path weight for the "path" attribute in the Path Weights Editor of the Spy tool.
For more information please take a look at the attached screenshot: Regards,
Markus
You do not have the required permissions to view the files attached to this post.
Re: Identify elements from pane
Hi Markus,
Thank you for Screenshot. As you have mentioned, this instance is for new records but what would be the solution for the already recorded Test Cases/Scripts? Those scripts should also work on other servers.
Thanks in advance,
Varun.
Thank you for Screenshot. As you have mentioned, this instance is for new records but what would be the solution for the already recorded Test Cases/Scripts? Those scripts should also work on other servers.
Thanks in advance,
Varun.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Identify elements from pane
Hi,
You have to manually adapt the RxPath of the existing repo items of your repositories.
I suppose there is a root item in your repository which represents the RxPath to the root dom object, this single repo item has to be changed.
Regards,
Markus
You have to manually adapt the RxPath of the existing repo items of your repositories.
I suppose there is a root item in your repository which represents the RxPath to the root dom object, this single repo item has to be changed.
Regards,
Markus