To determine the OS of mobile operating system you can use javascript.

Following is the javascript to android phone

function isAndriod() { 
 if( navigator.userAgent.match(/Android/i) {
 return true;
} else {
  return false;
}

And following is the javascript to detect the IOS devices

function isIOS() { 
 if(navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i)) {
 return true;
} else {
  return false;
}

You can execute this javascripts using JavascriptExecutor of and based on return value you can perform your future operations.



Source link https://sqa.stackexchange.com/questions/17214/can-selenium--detect-which--it-is--in

LEAVE A REPLY

Please enter your comment!
Please enter your name here