Description.Create with same propertie and different values, not working - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: Description.Create with same propertie and different values, not working (/Thread-Description-Create-with-same-propertie-and-different-values-not-working) |
Description.Create with same propertie and different values, not working - ttralor - 01-07-2013 Hello, I want to count the number of WebElements with the propertie "innertext" and the values "Blue Skies Airlines 360" AND "Blue Skies Airlines 361". On my AUT there are two of these objects on my page. This is my QTP code: ---------------------------------------------------------------------- Code: Set flight=Description.Create() I run with the "Run one iteration only" option. The number of flights QTP returns is 1 and not the expected 2. What i am doing wrong? (i think i have to build in a loop, but i cannot get it ok) RE: Description.Create with same propertie and different values, not working - harishshenoy - 01-08-2013 because it considered the recent 'innertext' value i.e 'Blue Skies Airlines 361' which is only 1 on the screen , in this case you have to use the regular expression , while taking count of the object you have to use the properties which are sufficient to identify the similar types of objects. Try the below code, I think this will return 2 for you: Code: Set flight=Description.Create() Thanks, Harish SHenoy RE: Description.Create with same propertie and different values, not working - ttralor - 01-13-2013 Harish thank you very much for your answer! I just started with QTP (and with programming) and did not realise that the most recent value, in this situation, is the value QTP is working with. That is a good learning lesson for me. I will try it with regular expression. (my english is sometimes not 100% good, because i live in Holland) Thanks! |