Hi,
I have this big table with lots of columns and rows. When i mapp the table in repository from the ranorex spy it works. I mean i can highlight it in the spy and from the repository.
However, when i update that page, the whole table is regenerating which makes my repository item to stop working. I cannot highlight the item from repository or from spy, until i refresh the spy.
For ex:
.//td[#'P13adff7a8d43469e89844599c4233b02_6_oReportCell']/table//td/table/tbody/tr[5]/td[1] (first)
.//td[#'P13adff7a8d43469e89844599c4233b02_7_oReportCell']/table//td/table/tbody/tr[5]/td[1] (2nd)
As you see there is a tiny change.
/td[#'P13adff7a8d43469e89844599c4233b02_7_oReportCell']?
I can make that part to be not unique, but that will find many other tables/fields which i dont want to.
So anyone that have similar problems or know the solution please let me know.
Thanks guys.
Table is not recognized after a refresh/update of page
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Table is not recognized after a refresh/update of page
Hi Fimo,
When the id of a web element is not unique you could use another attribute instead.
Are there any other unique attributes which can be used?
It may also be possible to use regex in this case (td[~'P13adff7a8d43469e89844599c4233b02'']).
In order to analyze this in detail may I ask you to post a Ranorex snapshot file of your webpage?
Regards,
Markus
When the id of a web element is not unique you could use another attribute instead.
Are there any other unique attributes which can be used?
It may also be possible to use regex in this case (td[~'P13adff7a8d43469e89844599c4233b02'']).
In order to analyze this in detail may I ask you to post a Ranorex snapshot file of your webpage?
Regards,
Markus
Re: Table is not recognized after a refresh/update of page
Hi Marcus,
Thanks for reply.
I've tried to find another unique attribute, but cannot find any that i can use.
I've tried to make a snapshot file for the last 30mins, but it doesnt work.
The spy tool hangs and i thought it just takes long time, but even after 30m no luck.
Maybe its to heavy for ranorex spy?
I'm not sure exactly why it stops, it works fine with other webpages to create a snapshot.
Anything else i can try?
Thanks for reply.
I've tried to find another unique attribute, but cannot find any that i can use.
I've tried to make a snapshot file for the last 30mins, but it doesnt work.
The spy tool hangs and i thought it just takes long time, but even after 30m no luck.
Maybe its to heavy for ranorex spy?
I'm not sure exactly why it stops, it works fine with other webpages to create a snapshot.
Anything else i can try?
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Table is not recognized after a refresh/update of page
Hello fimo420,
It should not take that long to make a snapshot even if the application has a lot of elements.
Which Ranorex version do you use?
Did you install all prerequisites of Ranorex?
Which technology do you use within in your application?
Do you get any warning or error message?
Did you try to use the regex expression suggested by my colleague?
Is it possible to uniquely identify your elements with it?
Thanks in advance.
Regards,
Markus (T)
It should not take that long to make a snapshot even if the application has a lot of elements.
Which Ranorex version do you use?
Did you install all prerequisites of Ranorex?
Which technology do you use within in your application?
Do you get any warning or error message?
Did you try to use the regex expression suggested by my colleague?
Is it possible to uniquely identify your elements with it?
Thanks in advance.
Regards,
Markus (T)
Re: Table is not recognized after a refresh/update of page
Hi Markus,
My ranorex version is latest, 4.1.1
Everything required to ranorex is installed, and works fine
There are no warnings or messages that i can see.
I mean i can take snapshots of my other applications/webpages.
And the page/tool that we are trying to mapp/work with is:
Microsoft SQL Server Report Manager, inside it we have a xml reporting page that have lots of tables.
I've tried the regexp, but ranorex doesnt accept it.
ex:
.//td[#'P13adff7a8d43469e89844599c4233b02_6_oReportCell']/table//td/table/tbody/tr[5]/td[1]
tried to put it like:
.//td[~'P13adff7a8d43469e89844599c4233b02']/table//td/table/tbody/tr[5]/td[1]
But ranorex doesnt let me save it.
Let me know if theres anything else you want from me.
I'm attaching a screenshot of the spy if that helps, since snapshot is not possible
My ranorex version is latest, 4.1.1
Everything required to ranorex is installed, and works fine
There are no warnings or messages that i can see.
I mean i can take snapshots of my other applications/webpages.
And the page/tool that we are trying to mapp/work with is:
Microsoft SQL Server Report Manager, inside it we have a xml reporting page that have lots of tables.
I've tried the regexp, but ranorex doesnt accept it.
ex:
.//td[#'P13adff7a8d43469e89844599c4233b02_6_oReportCell']/table//td/table/tbody/tr[5]/td[1]
tried to put it like:
.//td[~'P13adff7a8d43469e89844599c4233b02']/table//td/table/tbody/tr[5]/td[1]
But ranorex doesnt let me save it.
Let me know if theres anything else you want from me.
I'm attaching a screenshot of the spy if that helps, since snapshot is not possible
You do not have the required permissions to view the files attached to this post.
Re: Table is not recognized after a refresh/update of page
You must tell Ranorex what to compare the regex too.
td[@id~'P13adff7a8d43469e89844599c4233b02']/table//td/table/tbody/tr[5]/td[1]
Notice the "@id" - this tells the RanoreXPath to check the ID attribute of the element for the given pattern. You left that out in your example, which is an error, and why it won't save.
The "#" is shorthand for "id=" and is used when the ID is absolutely unique and can be hashed for quicker searches. It is almost always FASTER (for Ranorex at runtime) to find an element using "#", but sometimes you may not be able to do that because the "#" requires a perfect, exact match for the given ID.
td[@id~'P13adff7a8d43469e89844599c4233b02']/table//td/table/tbody/tr[5]/td[1]
Notice the "@id" - this tells the RanoreXPath to check the ID attribute of the element for the given pattern. You left that out in your example, which is an error, and why it won't save.
The "#" is shorthand for "id=" and is used when the ID is absolutely unique and can be hashed for quicker searches. It is almost always FASTER (for Ranorex at runtime) to find an element using "#", but sometimes you may not be able to do that because the "#" requires a perfect, exact match for the given ID.
Shortcuts usually aren't...
Re: Table is not recognized after a refresh/update of page
Hi krstcs,
Thanks, i forgot that:
I did try the way you suggested :.//div[@id~'.*']/table/tbody/tr[5]/td[1]/table/tbody
Since the div id is unique everytime it regenerates
But it takes long time, over 1m...
I tried to regenerate the path without the "enable search by unique" setting, so that i get full path.
The path become very long but i added a regexp for all unique id's and it goes much faster and works for the moment
"
?/?/form[@id='ui_form']/span[1]/table/tbody/tr[2]/td/table//span/table//span[@id='ctl32_ReportViewer']/div[@id='ctl32']/table[@id='ctl32_fixedTable']//div[@id='ctl32_ctl09']/div[@id='VisibleReportContentctl32_ctl09']/div[@id~'.*']/table//td[@id~'.*']/div[@id~'.*']/table/tbody/tr[5]/?/?/table/tbody"
Thanks, i forgot that:
I did try the way you suggested :.//div[@id~'.*']/table/tbody/tr[5]/td[1]/table/tbody
Since the div id is unique everytime it regenerates
But it takes long time, over 1m...
I tried to regenerate the path without the "enable search by unique" setting, so that i get full path.
The path become very long but i added a regexp for all unique id's and it goes much faster and works for the moment
"
?/?/form[@id='ui_form']/span[1]/table/tbody/tr[2]/td/table//span/table//span[@id='ctl32_ReportViewer']/div[@id='ctl32']/table[@id='ctl32_fixedTable']//div[@id='ctl32_ctl09']/div[@id='VisibleReportContentctl32_ctl09']/div[@id~'.*']/table//td[@id~'.*']/div[@id~'.*']/table/tbody/tr[5]/?/?/table/tbody"
Re: Table is not recognized after a refresh/update of page
I would suggest that using ".*" as your regex comparison is not a good idea as it will find EVERYTHING.
From what you had posted earlier, your ids only change by a little bit each time. You could still use the first segment of characters and it would go faster.
td[@id~'P13adff7a8d43469e89844599c4233b02'] (only finds the td elements at this level that have the given match string in them)
instead of
td[@id~'.*'] (finds every td element at that level)
If your div id is Dynamic (it changes every time you run the app) then you may need to find a different attribute to key off of. Or, you should talk to your developers about what they might be able to do to make each element unique.
From what you had posted earlier, your ids only change by a little bit each time. You could still use the first segment of characters and it would go faster.
td[@id~'P13adff7a8d43469e89844599c4233b02'] (only finds the td elements at this level that have the given match string in them)
instead of
td[@id~'.*'] (finds every td element at that level)
If your div id is Dynamic (it changes every time you run the app) then you may need to find a different attribute to key off of. Or, you should talk to your developers about what they might be able to do to make each element unique.
Shortcuts usually aren't...
Re: Table is not recognized after a refresh/update of page
Yeh you're right about the ".*", but thats the only way i can use it now. The whole id is dynamic after you refresh the page by closing and restarting browser.
This specific page is generated from "Microsoft SQL Server Report Manager", so i cannot talk to Microsoft guys about this
So, its out of my hand, but hey it still works as of now with .* even if its a bit heavy and takes 30s more.
This specific page is generated from "Microsoft SQL Server Report Manager", so i cannot talk to Microsoft guys about this
So, its out of my hand, but hey it still works as of now with .* even if its a bit heavy and takes 30s more.
Re: Table is not recognized after a refresh/update of page
That's unfortunate, but I understand.
Microsoft is one of the worst offenders when it comes to correctly implementing their own automation framework.
Glad it is working for you.
One thing you might do is looking for a pattern in the id. Do they always start with a letter? Do that always have hexadecimal characters after that? Etc. You can then create a more precise, but still generic pattern match that should still be better than ".*". But you probably thought of that.
Microsoft is one of the worst offenders when it comes to correctly implementing their own automation framework.
Glad it is working for you.
One thing you might do is looking for a pattern in the id. Do they always start with a letter? Do that always have hexadecimal characters after that? Etc. You can then create a more precise, but still generic pattern match that should still be better than ".*". But you probably thought of that.
Shortcuts usually aren't...