Spread the love

How to Get List Name of a SharePoint link in UFT ?

Spread the love

How to Get List Name of a SharePoint link in UFT ?
How to Get List Name of a SharePoint link in UFT ?

How to Get List Name of a SharePoint link in UFT ?

SharePoint is the webApp designed by Microsoft. But as per HP passport site SharePoint is compatible with UFT. Also While browsing through advancedqtp site  I got an idea how to automate sharePoint using UFT’s descriptive Programming.  Now getting list name from a sharePoint link is tricky. Here is an example how to do that:

msgbox getListName("your_SharePoint_URL")

The implementation will be as follows:

Function getListName("your_SharePoint_URL")
// this is to close the all open IE
SystemUtil.CloseProcessByName "IEEXPLORE.exe"
// open the sharePoint url
SystemUtil.run "iexplore.exe",your_SharePoint_URL
// This piece of code to navigate to the list settings
Browser("MicClass:=Browser").Page("MicClass:=Page").Link("html tag:=A","text:=LisList Tools Group").click
Browser("MicClass:=Browser").Page("MicClass:=Page").Link("html tag:=A","text:=LisSettings").click
Browser("MicClass:=Browser").Page("MicClass:=Page").Sync
//now the trick is to click on the address bar to get the url having List Name Until and unless we 
//click on the address bar sharepoint will not display the modified url with list name.
//The below code will click on the address bar
Browser("MicClass:=Browser").Page("MicClass:=Page").WinObject("name:=AddressDisplay Control").click
wait 2
urlwithListName=Browser("MicClass:=Browser").GetROProperty("url")
// now the url will look like= sharepoint link along with listname=some encoded string
//In order to get the list name we need to split the url with "List=" 
afterCut=split(urlwithListName,"List=")
//afterCut(0) will contain remaining part
//afterCut(1) will contain encoded list name. To get the actual name of the list,we can create our own 
//decoder or the easiest way to get that is to open bing's url decoder.
//I have coded to go to the bing decoder
Browser("MicClass:=Browser").navigate("https://www.bing.com/search?q=url+decoder")
//It will open the url decoder 
//setting the encoded list name in the text 
Browser("MicClass:=Browser").Page("MicClass:=Page").Frame("micClass:=Frame","html id:=third5302","html 
tag:=IFRAME").WebEdit("micClass:=WebEdit","html id:=text","name:=WebEdit").set afterCut(1)
//Click on the button
Browser("MicClass:=Browser").Page("MicClass:=Page").Frame("micClass:=Frame","html id:=third5302",
"html tag:=IFRAME").WebButton("miClass:=WebButton","html id:=decode",
"html tag:=Button","name:=Decode").Click
//get the decoded List name
LisName=Browser("MicClass:=Browser").Page("MicClass:=Page").Frame("micClass:=Frame","html id:=third5302",
"html tag:=IFRAME").WebEdit("micClass:=WebEdit","html id:=text","name:=WebEdit").getROProperty("value")
// this is to close the all open IE
SystemUtil.CloseProcessByName "IEEXPLORE.exe"
getListName=ListName
End Function

This is how we should be able to get the list name from a sharePoint.

READ  How To Configure SharePoint's Services In UFT ?
READ  Synchronization in QTP or UFT




Spread the love
Animesh Chatterjeehttps://techtravelhub.com/
I am the founder and owner of the blog - TechTravelHub.com, always love to share knowledge on test automation,tools,techniques and tips.I am a passionate coder of Java and VBScript.I also publish articles on Travel ideas and great honeymoon destinations.Apart from these, I am a gear-head,love to drive across India. I have shared lots of articles here on How to travel several parts of India.Customization of cars aka car modification is my another hobby.Get in touch with me on ani01104@gamil.com

Related Articles

Learn Object Repository in UFT in An Efficient and Fast Manner

Object Repository in UFT The post will cover the following topics Details...

Comments

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Recent Posts

Super Keyword in Java Simplified

Super Keyword Super Keyword in Java Simplified: Java defines a special...

Learn Object Repository in UFT in An Efficient and Fast Manner

Object Repository in UFT The post will cover the following...

Learn What Primary Tools For Test Automation

Primary Tools For Test Automation According to the Gartner report...

EDITOR PICKS


Spread the love