Monday, October 10, 2016

TaskList Command: Working with taskmanager from cmdline


 ‘’List all the task processes  
 c:\>TASKLIST  

 ‘’List all the tasks which match the process name  
 c:\>TASKLIST /FI "IMAGENAME eq chrome.exe" 
 
 ‘’List all the tasks based on application window title.  
 ‘’We can use regular expression to get the process  
 c:\>TASKLIST /FI "Windowtitle eq ECLIPSE*"  

 ‘’we can store information to a txt file using below command  
 c:\>TASKLIST /FI "IMAGENAME eq chrome.exe" >abc.txt  

 ‘’Below command will return the service for the process and save it in file abc.txt in c: drive
 c:\>TASKLIST /FI "IMAGENAME eq chrome.exe" /svc >abc.txt  


Reference: http://ss64.com/nt/tasklist.html


Sunday, September 25, 2016

Switching to frame, Windows, alert in Selenium WebDriver

1. How to Switch from one frame to another

 // How to Switch from one frame to another  
 WebElement iFrmeElement = driver.findElement(By.xpath("xPath for Frame"));  
 driver.switchTo().frame(frameElement);  
 //Or  
 driver.switchTo().frame(id or name)  
 //Or  
 driver.switchTo().frame(index of frame)  

2. We can switch to default again by:

 driver.switchTo().defaultContent();  

3. We can switch to a window based on name, Id or Windows handle

 driver.switchTo().window("windowName");  

4. We can switch to an alert

 Alert alert = driver.switchTo().alert();  
 // We can close an alert using methods for alert object  
 alert. accept();