if double quotes comes in outer html - 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: if double quotes comes in outer html (/Thread-if-double-quotes-comes-in-outer-html) |
if double quotes comes in outer html - sujaravi123 - 04-04-2012 Hi I want to identify my object using it's outer html property as given below Browser("Title:=Arbitron Cross-Platform Campaign Analyzer").Page("Title:=Arbitron Cross-Platform Campaign Analyzer").Webelement("html tag:=TD","outerhtml:=<TD style="FONT-STYLE: normal; FONT-FAMILY: Arial Unicode MS, Arial, sans-serif; WHITE-SPACE: nowrap; COLOR: black; FONT-SIZE: 12px; VERTICAL-ALIGN: middle; FONT-WEIGHT: normal" align=left.*") But you can see there is a double quotes inside outer html before the "FONT-STYLE".Also the word "normal" inside the outer html is a keyword for QTP.So these creating problems in identifying the object Please help me in resolving these? RE: if double quotes comes in outer html - vIns - 04-05-2012 escape char for double quotes is adding 2 more double quotes to it. Try it... Print """hi""" it will print "hi" RE: if double quotes comes in outer html - sia sharma - 10-17-2012 This is my code and it still gives error after using "" Code: Browser("abc").Page("xyz") .WebElement("html tag:=SPAN","outerhtml:=<SPAN style=""COLOR: #1274c0; FONT-SIZE: 12px; FONT-WEIGHT: bold"">+(91)-22-61638369</SPAN>").Click How to deal with this Thanks Sia RE: if double quotes comes in outer html - harishshenoy - 10-18-2012 Hi, QTP even wont recognize few of the special charectors , u need to handle them also like a double quote. use '.'(dot) for sinle charector. here is the below expression that might work , also its better to recognize the object with 'class' , html id' rather than 'outer html'....try to use other properties as well. Code: Browser("abc").Page("xyz") .WebElement("html tag:=SPAN","outerhtml:=.SPAN style.""COLOR. .1274c0. FONT.SIZE. 12px. FONT.WEIGHT. bold""...91..22.61638369..SPAN.").Click Harish |