09-08-2010, 08:10 PM
(This post was last modified: 09-08-2010, 08:44 PM by jsknight1969.)
I'll try to clarify.
First using DP ignores the OR, but I'm sure you knew that.
When using DP, you must be very specific in your object to get only one object. You might try using HTML ID instead of Text. If you have a dozen links on a page that all have the text of "Edit", they will all be returned in the child objects and you can use the index key to get the one you want.
That is what this did. You can change the "0" to the index option you need. When you use a .NET Grid or List object that is the only way to click the correct link in the data. There are ways to search the table for the row you need, provided there is a unique key or data, then use that as the array index as well.
In my click framework, I pass the index with a default of "0" so at the very least it will click the first object in the array.
Be sure you are setting your micclass. Also, try using Regular expressions to search for the text of the link. That might help narrow down the objects array so you won't have to deal with the indexing.
I hope this helps.
I don't think I explained that very well, so I decided to share my framework. I'm sure there is a lot of room for improvement but it suits my needs and makes it very simple for my team to reuse the code.
There are some page/browser variables you need to set at the top of the code to work with the website you are working with. After that it the framework should work fine. I generally include another library setting those values, but for this upload it's all one file.
Documentation is always a work in progress for me, so I apologize if it's a little lax in some areas.
I hope you find this useful.
First using DP ignores the OR, but I'm sure you knew that.
When using DP, you must be very specific in your object to get only one object. You might try using HTML ID instead of Text. If you have a dozen links on a page that all have the text of "Edit", they will all be returned in the child objects and you can use the index key to get the one you want.
Code:
linkarray(0).Click
That is what this did. You can change the "0" to the index option you need. When you use a .NET Grid or List object that is the only way to click the correct link in the data. There are ways to search the table for the row you need, provided there is a unique key or data, then use that as the array index as well.
In my click framework, I pass the index with a default of "0" so at the very least it will click the first object in the array.
Be sure you are setting your micclass. Also, try using Regular expressions to search for the text of the link. That might help narrow down the objects array so you won't have to deal with the indexing.
I hope this helps.
I don't think I explained that very well, so I decided to share my framework. I'm sure there is a lot of room for improvement but it suits my needs and makes it very simple for my team to reuse the code.
There are some page/browser variables you need to set at the top of the code to work with the website you are working with. After that it the framework should work fine. I generally include another library setting those values, but for this upload it's all one file.
Documentation is always a work in progress for me, so I apologize if it's a little lax in some areas.
I hope you find this useful.