![]() |
Select From List - 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 Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others) +--- Thread: Select From List (/Thread-Select-From-List) |
Select From List - rahul1234 - 11-05-2009 Hi All, In an interview interviewer asked me one question, i could not ans. that. I am posting that question here and hope that i will get correct answer. Scenario: You have two list box. In one list contains state name and second list contains district name. Question: What would be your approach or code If i chose one state from state list then district list should display all the district for that particular state[/b]. RE: Select From List - venkatbatchu - 11-05-2009 Hi, Les take this scenario, By selecting State1 from state list then District1, district2, district3 has to dispaly 1. m=First select state1 from state 2.n=Get the all items displayed under district list i.e Getroproperty("all items") (Note: It will display with any delimeter like district1;district2;district3) (usually developers will display with any delimeter) 3. All item consists of then split the total items with ; delimeter 4. Use the if else condition like if (m=n) use reporter event with pass else reporter event with fail End if This is the way u have to proced... Please let me know if u need any information apart from this... RE: Select From List - Saket - 11-06-2009 Hi Venkat, I think your logic needs to be modified a bit. in your fourth statement , you are comparing state with the district i.e - m = n, right? this is of no use. rahul1234 -You must have the expected data list for state and respective district prepared in order to verify the district list. First You will have to keep all the state and district in an excel can be imported in datattable. then select a state, get all the items in your district list. get all the districts from the xls for the state selected verify all the districts are there in the list or not. let me know if there is any issue. RE: Select From List - venkatbatchu - 11-06-2009 Hi Saket, Thanks for updating me about that, i have modified and keeping the logic here Code: Browser("xxxxxxxxxx").Page("xxxxxxxxxx").Frame("main").WebList("p_states").Select("State1") Please let me know if u need any information apart from this... RE: Select From List - Saket - 11-06-2009 That's great you have got a similar application. ![]() I am sure this will definitely help to rahul1234. RE: Select From List - venkatbatchu - 11-06-2009 Hi Saket, This is not my application which i have developed all this things in my product and developed script mine is product based application thats the reason i have developed.... RE: Select From List - rahul1234 - 11-08-2009 Thanks thanks a lot to Saket and Venkat. That solve my problem. Thanks for your reply and great work. RE: Select From List - venkatbatchu - 11-09-2009 Hey Rahul, Thanks alot... |