![]() |
Hepl required to dyanamically identified username and create the object in object rep - 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: Hepl required to dyanamically identified username and create the object in object rep (/Thread-Hepl-required-to-dyanamically-identified-username-and-create-the-object-in-object-rep) Pages:
1
2
|
Hepl required to dyanamically identified username and create the object in object rep - Saisu - 11-20-2011 Am trying to autoamte the web application and in the same in one of the steps haveto click on the Username link and the username is unique for each customer, Username mailAddress ID Name Phone Number Smith smith@gmail.com 123789 smithg - Based on the Id search we were on the above page so here have to automate to click the username(Contains href) and have to proceed to another page Every time user changes and QTP failing by object is not found in repositry - yes true every time objects changes based on ID search and here is my code. Code: Browser("Browser").Page("Page").WebButton("Yes I Am!").Click So please help our here. Thanks, Saisu RE: Hepl required to dyanamically identified username and create the object in object rep - ravi.gajul - 11-20-2011 Hi, In the object repository , use .* for the property(inner text) holding the customer name. If this doesn't help please post the object spy snapshot of teh link. Regards, Ravi RE:Hepl required to dyanamicallyidentified username and create theobject in objectrep - Saisu - 11-21-2011 Hi Ravi, Many thanks for your quick response I skipped that from my requirement didn't try that I stucked here please help me When i searched with ID if it returns 0 records it has give amssg box and it's not giving properly ie on the page it showing 0 records however it is going to else loop -my logic should be if 0 records it has to exist loop and procced for the next steps if search returns 1 record take me to prevoius step ie customer search page ... And each and every time it has to check the records count 0 or 1 and my code is here Code: Browser("Browser").Page("Page").Frame("workarea").WebEdit("v_value").Set "0125672348" after clicked on the page got the page and the page contains text like 0 records returned so i write code like Code: if result="0 records returned" Then And my logic should be each and every time after click on search it has to check every time for records whether 0 or 1 and based on that it has exit the loop and has procced ..... Any clue help me Thanks, Saisu RE:Hepl required to dyanamicallyidentified username and create theobject in objectrep - Ankesh - 11-22-2011 can u try the below code... Do Code: Browser("Browser").Page("Page").Frame("workarea").WebEdit("v_value").Set "XYZ" Do let me know if it works. Regards, Ankesh RE: Hepl required to dyanamically identified username and create the object in object rep - Saisu - 11-24-2011 Hi Ankesh, I tried however am getting error .And am attaching the screen shot for my spy . Please show me a path to get progress on this Advance thanks. Thanks, Saisu RE:Hepl required to dyanamicallyidentified username and create theobject in objectrep - Ankesh - 11-24-2011 I saw the screenshot.. u r using Code: strResultMsg= Browser("Browser").Page("Page").Frame("workarea").webelement("ObjectName>").GetROProperty("0 records returned") which is wrong. Plz use the innertext property. Plz replace the code at line 74 and line 85 with the below code... Code: strResultMsg= Browser("Browser").Page("Page").Frame("workarea").webelement("Search").GetROProperty("innertext") Regards, Ankesh RE:Hepl required to dyanamicallyidentified username and create theobject in objectrep - Saisu - 11-24-2011 Hi Ankesh, Tried and i got the below error The "Search" object was not found in the Object Repository. Check the Object Repository to confirm that the object exists or to find the correct name for the object. Line (72): Code: "strResultMsg= Browser("Browser").Page("Page").Frame("workarea").webelement("Search").GetROProperty("innertext")". Tip: If the objects in your application have changed, the Maintenance Run Mode can help you identify and update your steps and/or the objects in your repository. Thanks, Saisu RE: Hepl required to dyanamically identified username and create the object in object rep - Ankesh - 11-24-2011 Saisu, That error means you have not added the object into the Object Repository. Please add the object to OR. I got that name from the attchment you have provided. So i have given you the code. Please add the object and re execute. Regards, Ankesh RE: Hepl required to dyanamically identified username and create the object in object rep - Saisu - 11-24-2011 Hi Ankesh, It's already there in OR please find the screenshot for the same . If my understanding is wrong coreect me Thanks, Saisu. RE:Hepl required to dyanamicallyidentified username and create theobject in objectrep - Ankesh - 11-24-2011 Saw the screenshot. The one you have highlighted is a WebButton. Where as in the below code which we are using is WebElement. This the object which u get when you hit Search. I mean this object will hold the value "0 records returned" or "1 records returned". Plz add the object which dispalys the above msg to OR and use the Same name, as in OR, in the below code in place of ResultMsgObjectName. Code: strResultMsg= Browser("Browser").Page("Page").Frame("workarea").webelement("<ResultMsgObjectName>").GetROProperty("innertext")". Regards, Ankesh |