Hi, Is there a way we can write a common function for a sync operation... say we have Browser(x).Page(x).Obj1(x).sync and Browser(x).Page(x).Obj2(x).sync and so on.... Can we write one common statement and call the sync function by passing the object type. Appreciate all your help.. Thanks
How to write a genecric function for sync operation
|
Hi Martinangello,
Please find the below function which will work well only by passing the browser and page names. Eg: f_waitForPage "x","x" Code: Public Function f_waitForPage(ByVal BrowserName, ByVal PageName)
Thanks,
SUpputuri
QTP King,
Thanks for such a quick response... But sync is not my main objective... to write a generic function is what i'm breakin my head on.. well, lemme rephrase... say we have an imagebutton,link, webbutton... If i need to click on these, can i write a single click function which would work for all three( when i pass these values via a variable)... Aprreciate your help... thanks
Hi Martinangello,
yes we can write only one function which can work on different objects(Imagebuttons,webbuttons,links) based on the variables. you can use "case" to handle this situation in while developing function. Let me know if you wan me to devlop the function.
Thanks,
SUpputuri
QTP King,
Yes please... Or gimme some hints if u r too busy... thanks so much
Hi Martin,
Pleae find the below LOC and let me know it's OK with you. Code: 'LOC to click on the button
Thanks,
SUpputuri
What I have right now is a bit similar to this... but i'm tryin to write somethin more simpler/compact... well , lemme add more details... Browser(x).Page(y).Link(z).click... x,y,z are global variables and are read from an excel... every row in the excel has diff values for x,y,z... I use 'Execute' statement instead of the Call Function as the no of parameters to be passed varies from function to function... In the same way if i wanna hv a sync function (page sync alone wont work, as some objects load wel after the page has loaded) i'l hv several lines like
Browser(x).Page(y).Link(z).sync.......Browser(x).Page(y).Image(z).sync.....Browser(x).Page(y).weblist(z).click.... etc... Now can i handle these dynamically? like creating an object or something and just use obj.sync? Please advice... and sorry for dragging this thing....THANKS
One can also have different wait time defined in the environmental variable file and call it as appropriate.
Tarik,
Thanks... but instead of a wait function if i learn how to write a generic function, i'll be able to club so many things... like, i can use one click statement for link, button, image etc... one set statement for text and checkbox.. and so on... please help if u can... Thanks
Hi Martina,
try this script for click button Eg:- using the descriptive programming Code: Sub click_button() call the sub procedure in your test click_button() i am using some browser script for the example only , implement ur script like this kindly let me know if u have any query Regards Bala |
« Next Oldest | Next Newest »
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
![]() |
Cross Browser Sync Not Working | geodude | 0 | 2,030 |
04-07-2017, 08:43 AM Last Post: geodude |
Calling a function in a Test Script from a function library | anupam4j | 3 | 6,297 |
06-26-2015, 12:31 AM Last Post: babu123 |
|
How to use sync function | 22sumit | 2 | 3,586 |
06-16-2015, 06:27 PM Last Post: 22sumit |
|
The DataTable.ExportSheet operation failed. Invalid file. | Niraj | 2 | 6,427 |
05-05-2015, 11:40 PM Last Post: babu123 |
|
Excel operation - to find usedrange of rows & col | pooja | 1 | 9,880 |
02-19-2015, 04:06 AM Last Post: supputuri |
Users browsing this thread: 2 Guest(s)