Posts

Showing posts from April, 2019

How to upload a file using AutoIT?

Image
Download AutoIT from  https://www.autoitscript.com/site/autoit/downloads/  as shown in the below image Download AutoIT  Script Editor from  https://www.autoitscript.com/site/autoit/downloads/  as shown in the below image Double click on the " autoit-v3-setup.exe " to install AutoIT. Double click on the " SciTE4AutoIt3.exe " to install AutoIT Script Editor. Once you are done with the installation, you can see Identifier or Finder tool in the below path C:\Program Files (x86)\AutoIt3\ Au3Info_x64.exe You need to double click on it to open Finder Tool Methods to be used ================== ControlFocus ( "title", "text", controlID ) : Sets input focus to a given control on a window. ControlSetText ( "title", "text", controlID, "new text" [, flag = 0] ) : Sets text of a control ControlClick ( "title...

How to send email notification from Jenkins with TestNG Report?

Image
1. If you don't how to configure Jenkins and run project then please            refer  http://seleniumbestpractices.blogspot.com/2018/08/how-to-run-selenium-project-from.html 2. start jenkins.war file to get started with Jenkins. 3. Go to http://localhost:8080 to open Jenkins. Required Plugins *********************** Email Extension Email Extension Template Plugin TestNG Results Selenium HTML Report Configuration for Sending Email ****************************************** Go to Jenkins => Manage Jenkins => Configure System => Email Notification Enter " smtp.gmail.com " in the " SMTP Sever " edit field  NOTE : we will take gmail as an example Click on " Advanced " and do the configuration as shown in the below image. Username and password need to be provided for the account from where you want to send the email notification. For testing purpose, check the " Test configuration by sending test e-mail ...

How to find broken links on a web page?

package selenium; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; import java.util.List; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class LinkChecker { WebDriver driver; @BeforeClass public void setUp(){ System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir")+"//drivers//chromedriver.exe"); driver = new ChromeDriver(); driver.manage().window().maximize(); driver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS); driver.get("http://newtours.demoaut.com"); } @Test public void findBrokenLinks() throws IOException{ List<WebElement> allLinks = driver.fin...