Tuesday, June 2, 2020

How to open a link in new tab of chrome browser using Selenium WebDriver




driver.execute_script('''window.open("http://google.com","_blank");''')

How to find element inside iframe or not using selenium



Int size = driver.findElements(By.tagName("iframe")).size();

  • driver.switchTo().frame(0);
  • driver.switchTo().frame(1);

 for(int i=0; i<=size; i++){
 driver.switchTo().frame(i);
int total=driver.findElements(By.xpath("html/body/a/img")).size();

AutoIt :How to use AutoIt selenium java

1) install autoit.
2) open finder tool -- finding controls.
3) open scite --(like IDE)
4) write code---controlfous,controlsettext,controlclick
5) save it
6) compile and generate exe.
7) // below line execute the AutoIT script .
     Runtime.getRuntime().exec("E:\\AutoIT\\FileUpload.exe");

AutoIT : How to use AutoIt selenium c#

  1. IWebDriver driver = new InternetExplorerDriver();  
  2. driver.Navigate().GoToUrl("http://localhost/Home/StephenSecrets");  
  3. //Thread.Sleep(500); //if required  
  4. AutoItX.WinWaitActive("Windows Security");  
  5. AutoItX.ControlSetText("Windows Security""""Edit1""TestUser"); //replace testuser with actual username (with domain if required)  
  6. AutoItX.ControlSetText("Windows Security""""Edit2""Password_test"); //replace Password_test with actual Password  
  7. AutoItX.Send("{ENTER}"); 



How many ways to handle basic authentication window Selenium c#



Monday, June 1, 2020

The important few steps to build a successful testing career.


  • Don’t be afraid on pressing any button from the app that you are testing , it will not cause any harm.
  • Document your work , and here this will include  to have tasks for every testing activity , test cases if possible manageable in a tool like (Test link  or Test rail).
  • Be passionate in what are you doing and don’t compromise the quality of the product.
  • Put yourself in the end user skin.
  • Build test reports and share them with your team.
  • Keep your test cases up to date
  • Review your test cases with your product owner , to make sure you are always testing the right thing
  • Be open to suggestions
  • Try to automate your tests so you can speed up your test execution and you’ll be able to spent more time in exploratory testing

Javascrpirt in selenium



WebElement webElement = driver.findElement(By.xpath("xpath_element"));
JavascriptExecutor javaScriptExecutor = (JavascriptExecutor)driver;
javaScriptExecutor.executeScript("arguments[0].click()", webElement);


javaScriptExecutor.ExecuteScript("return jQuery.active == 0")


JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("return document.readyState").toString().equals("complete");