Hope you are all finding the solutions to the QTP problem as I always did in here.:-)
Now I m back with a question. I have a webelement which has source has ;<label for="ID">WebElementInnerText</label>
I need to get the value for "for" as ID. I did searched the site and found similar post but for "title" attribute. The solution was Page().WebElement().GetRoProperty("attribute/title"). I changed it to Page().WebElement().GetRoProperty("attribute/for") and it giving me blank.. :-(
Please help me!
Hi Eagles, Thankyou for the quick reply. I m somehow not getting the answer. It still throws me blank value..
WebElement("html tag:=LABEL","outertext:= ElementText").getroproperty("attribute/for") :-( Let me see if I can get around it meanwhile anybody has any idea, please reply to this post. Thanks in advance.
is WebElement("html tag:=LABEL","outertext:= ElementText").exist(0) returns True? your element says [WebElementInnerText] so your webelement should be [WebElement("html tag:=LABEL","outertext:= WebElementInnerText1")]
Easy way is this. If you still have issue then go with DOM
set objElement = B().P().Object.getElementsByTagName("LABEL")
Loop through the element and get the correct label
Once you fond the element that you want you can get the attribute.
Hi Eagles, Thank you so much again!
1. The exist was true for me, yet it gave me blank
2. I tried loop method and I found the value correct
3. modified the loop thing as below
WebElement("OR").Object.attributes("for").Value and it worked.. Problem Solved.. Why is this? No idea.. but it worked.. Thank You!