![]() |
Wincombobox issue - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Wincombobox issue (/Thread-Wincombobox-issue) |
Wincombobox issue - 1981.madhu@gmail.com - 10-26-2009 Hi, Code: Set a=CreateObject("scripting.filesystemobject") *** Above code is working fine when having the text file with values like this format ![]() But same textfile format values like,its not working .pls suggest me . Denver Frankfurt London Los Angeles Paris Portland Francisco Seattle Sydney Zurich RE: Wincombobox issue - Saket - 10-26-2009 You just need to investigate why the code is working for your first case? In in the required format itself, for the first case All the items are listed with a semicolon and in second its with a return character. use vbcrlf instead of ';' in your code. RE: Wincombobox issue - 1981.madhu@gmail.com - 10-26-2009 In my 1st case i hav text file values like :Va1;val2;and so on and retrived combobox values changed as c=c+g+";".so its working But now text file values as val1 val2 -- -- so on i changed the retrieved combobox values as c=c+g+vbcrlf But my code is not working,pls suggest RE: Wincombobox issue - basanth27 - 10-26-2009 Try with c=c+g+VBLF RE: Wincombobox issue - Saket - 10-27-2009 Hi Madhu, If the data in your text is seperated by return character, that means all the data val1,Val2 ... are in different lines. so if you will use ReadLine while retriving values from your text file it will always return the first value ie Val1 (with above statements in your code) and so the comarison will be fail. Use ReadAll to retreive all the text in your file and thenn compare, It should work. RE: Wincombobox issue - 1981.madhu@gmail.com - 10-27-2009 Saket ,yes i did b=a.readdall then i compared .Its not at all working . Changed the code as per saket AND Basanth ..still not working .Below one is my changed code as per saket Code: Set a=CreateObject("scripting.filesystemobject") RE: Wincombobox issue - Saket - 10-27-2009 "b = a.readdall"?? as per your code in the first post of this thread, you should use c=b.readall can you paste your complete code , may be that can help us to identify the issue. I tried with your earlier code, it working fine at my side with required modification. when you say not working at all means -are you getting any error message or your comparison fails? with your modified code you will get the error message "Expected statement", anyway- you can check with the code below Code: Set a=CreateObject("scripting.filesystemobject") also if you remove IF statement remove the End IF statement as well. |