adspace


Hi All,

An newbiee to silk test tool. I wanted to write a function
which checks the browser type installed in the local machine
& then based on the browser type test case should run.

I tried little bit writing the function :

Void Func_ValidateBrowserType()
Window myWin
myWin = Browser.GetRealBrowser ()
print (myWin)

Any help please..

Thanks,
V

Answer Posted / Anurag Singh Chauhan

In Silk Test, you can use the `GetCurrentBrowser()` method to get the current browser type installed on your local machine. Here is an example of how you could modify your function to check the browser type and run different test cases accordingly:nnVoid Func_ValidateBrowserType()n{nString browser = GetCurrentBrowser();nIf (browser == "Internet Explorer")n{n// Run IE-specific test casen}nElse If (browser == "Chrome")n{n// Run Chrome-specific test casen}nElse If (browser == "Firefox")n{n// Run Firefox-specific test casen}n}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

No New Questions to Answer in this Category !!    You can

Post New Questions

Answer Questions in Different Category