+ Start a Discussion
vasu takasivasu takasi 

How to cover the test coverage for getURL method

Hi , I have an if condition in my class which takes url using getUrl method, How to get in test coverage.






Please somebody can guide me.

Subha ASubha A
In the TestClass write ApexPages.currentPage().getParameters().setUrl(' ');
Subha ASubha A

as far as I know if you set a page in the TestClass then its url wil be set which will not be null...

Please ignore previous post it doesn't work



You need to test the method where you are using ApexPages.currentPage().getURL().If you are able to test the method,then you are good to go.