Running Shared Test in Multiple Address - 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: Running Shared Test in Multiple Address (/Thread-Running-Shared-Test-in-Multiple-Address) |
Running Shared Test in Multiple Address - Suba - 03-23-2011 Hi, I am new with QTP and self learning this tool. I have a question on how to setup dynamic address (URL) for the Same Test which has reusable actions, when they run? Since the Web Application is the same and behaves in a similar manner except the address, we plan to use the same dataset through datatable for each corresponding test. Please advise a simple and easy to implement solution. Thanks in advance for the help. Subha RE: Running Shared Test in Multiple Address - basanth27 - 03-24-2011 Use a tabular approach, In one column have all the url's and then read through each cell containing the url and pass it to the test/action. I may be wrong, probably because i may have not interpreted your question correctly. Would you please write up more detailed explanation which would help me to decode faster ? RE: Running Shared Test in Multiple Address - Suba - 03-24-2011 Basanth, I think you have intepreting it correctly. I am including a small example of a "login" Action and initial portion of some other Action (Say "ClientSearch"). I would like to access the similar application with dynamic URL which represents different environment (like Dev1, Dev2, QA1, QA2 and so on). For example: Some "x" address is used to launch the application staring with the login and going into other Action in sequence. How can I dynamically substitute with a different address "y" if I want to run the same test in a different environment? Will the dynamic substitution od address will dynamically take care the Browser and Page info as highligted below? Thanks in advance. Subha Login Action: Code: Browser("[b]ent_b_6_0_markdevlan_ent_b_6_0[/b]").Page("[b]ent_b_6_0_markdevlan_ent_b_6_0[/b]").WebEdit("LoginUsername").Set "Someone" ClientSearch Action: Code: Browser("ent_b_6_0_markdevlan_ent_b_6_0").Page("ent_b_6_0_markdevlan_ent_b_6_0").WebElement("Clients & Policies").Click RE: Running Shared Test in Multiple Address - basanth27 - 03-25-2011 Two things you may want to do, 1. Excel data input 2. Regular expression. First build your data input as such that there are 2 columns, 1. Url 2. Condition - Dev, QA, QA1 etc etc Check the browser properties, and the page properties, regular expression it such that it can be identified for all of the environments. On your script, loop through the excel and based on the CASE condition you need, if you want to run for QA then use the url defined for QA. Makes sense? RE: Running Shared Test in Multiple Address - Suba - 03-29-2011 Thanks Basanth, I will give a try. Can you also let me know how I can set and use the Environment variables - BROWSER_ENV and URL_ENV? Thanks, - Subha RE: Running Shared Test in Multiple Address - basanth27 - 03-29-2011 Since these are user defined variables, Test settings -> environment variables -> user defined create both the variables BROWSER_ENV and URL_ENV with blank values. On your script to assign a value to the variable, Environment.Value("BROWSER_ENV") = "varvAlue" To retrieve the value it holds, Msgbox Environment.Value("BROWSER_ENV") This should return varvAlue. Helps? RE: Running Shared Test in Multiple Address - Suba - 03-31-2011 Thanks Basanth. Will try to use as you suggested. In the meantime I have used it as below. Can I do better than this? Code: Set oIE = CreateObject("InternetExplorer.Application") Thanks, Subha RE: Running Shared Test in Multiple Address - basanth27 - 03-31-2011 Yes. Use, SystemUtil.Run "Iexplore.exe", "www.google.com" Or Learn about InvokeApplication. The one you have suggested is to be used purely if it is done only through vbscript. If you are doing through QTP then the ones i suggested are generally used. PS : Although answered, i am going to close this thread as it has deviated largely from the original intent of the question. Suba, Please open a new thread with the same question if you are not satisfied with the answer. RE: Running Shared Test in Multiple Address - basanth27 - 04-01-2011 Thread closed. |