Selenium

20

Solutions

1

Articles & Videos

38

Contributors

Selenium is a portable software testing framework for web applications. Selenium provides a record/playback tool for authoring tests without learning a test scripting language (Selenium IDE). It also provides a test domain-specific language (Selenese) to write tests in a number of popular programming languages, including C#, Groovy, Java, Perl, PHP, Python, Ruby and Scala. The tests can then be run against most modern web browsers. Selenium deploys on Windows, Linux, and OS X platforms. It is open-source software, released under the Apache 2.0 license, and can be downloaded and used without charge.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hello,
I have submitted Selenium and Eclipse questions and they were never answered.  
There are many topics that are "Proposed."
My assumption is that EE does not have Experts for these topics.  Is my assumption correct?
0
Get Database Help Now w/ Support & Database Audit
LVL 2
Get Database Help Now w/ Support & Database Audit

Keeping your database environment tuned, optimized and high-performance is key to achieving business goals. If your database goes down, so does your business. Percona experts have a long history of helping enterprises ensure their databases are running smoothly.

HI Expert

In my application a button click must open a page ( inside a frame) , manually the chrome browser loads the page withing  1 minute
but same action does not happen with the Selenium Web Driver Script ( button is clicked , but the page inside the frame does not load)

page loading will be  in progress infinitely,

Please suggest the workaround

I am using chrome version : 58.0.3029.110 (64-bit)
chrome driver version         : 2.29

Regards
Sai
0
Hello,
I've followed the instructions below and nothing happens.  I have searched the internet and can't find much more, so I ask you;
How does one install the Selenium 3.4 javadoc in Eclipse Neon 3?
INSTRUCTIONS:
http://stackoverflow.com/questions/25781853/how-to-bind-selenium-javadoc-to-eclipse
selenium-server-3.4.0-javadoc
Navigate To:
project properties => Java Build Path => Libraries => Selenium-java-2.42.2.jar
Select Selenium-java-2.xx.x.jar & Expand it.
You will see Javadoc location option. Select it and click on Edit button.
On next window add
http://seleniumhq.github.io/selenium/docs/api/java/ 
link in javadoc location path textbox and click on Ok button.
0
Hi, I am using the below code to match some data from an input csv to 2 drop downs from a website, then download both a csv and pdf... (the csv, I am extracting info from, then overwriting it with the next download since I do not need it -- the pdf, I am keeping, if the day of the month is the 1st or the 15th... but, as you can see here, for testing, I have it set to today, the 14th, instead of 15th)

My problem is that it will run Ok, for the first 10 lines or so (the csv list is between 1200-2500 lines, so i'm not even close..)
but then, it will throw the below error:

[Errno 10061] No connection could be made because the target machine actively refused it

Can anyone help me resolve this? I am new to python, scraping AND selenium so would appreciate any help -- or suggestions regarding making the code more efficient in general. Thank you!

# -*- coding: utf-8 -*-

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import unittest, time, os, shutil, csv
from fuzzywuzzy import process
import datetime

class Here(unittest.TestCase):
    def setUp(self):
        path_to_chromedriver = 'chromedriver.exe'  # change path as needed
        self.driver = webdriver.Chrome(executable_path=path_to_chromedriver)
        self.base_url = "https://mybaseurl/"
        

Open in new window

0
Mouse hover not working in internet explorer and chrome browser in selenium java. I am using below code.

// to handle dynamic index of pencil we used it
                        int i = index + 1;
                        String xpathPencil = "//*[@id='listGroup0']/a[" + i + "]/span[1]/button/i";
                        WebElement pencil = driver.findElement(By.xpath(xpathPencil));
                        action.moveToElement(StatusFilterListBox1.get(index)).perform();
                        // System.out.println("pencil coming");
                        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
                        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
                        action.click(pencil).perform();
                        waitForSpinnerToDisappear();
0
Code:
public static void main(String[] args) throws IOException,BiffException{

      
System.setProperty("webdriver.ie.driver","C:\\Users\\wer\\Desktop\\IEDriverServer.exe");
       WebDriver driver;
      
            driver =new InternetExplorerDriver();

                  File f1 = new File("C:\\Users\\wer\\Desktop\\Demo\\sai.xls");


      


      Workbook wbk;

      wbk = Workbook.getWorkbook(f1);

      Sheet sheet = wbk.getSheet(0);
      String username;

      username = sheet.getCell(0, 0).getContents();

      
Error:
Exception in thread "main" java.io.FileNotFoundException: C:\Users\wer\Desktop\Demo\sai.xls (The system cannot find the file specified)
      at java.io.FileInputStream.open0(Native Method)
      at java.io.FileInputStream.open(Unknown Source)
      at java.io.FileInputStream.<init>(Unknown Source)
      at jxl.Workbook.getWorkbook(Workbook.java:213)
      at jxl.Workbook.getWorkbook(Workbook.java:198)
      at test.main(test.java:98)
0
public class test {

      
public static void main(String[] args) throws AWTException, IOException, InterruptedException {
      
      
       WebDriver driver;
       System.setProperty("webdriver.ie.driver","**");
            driver=new InternetExplorerDriver();
      
      


      driver.get("**");
      driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

       WebDriverWait waiting = new WebDriverWait(driver, 10);
            waiting.until(ExpectedConditions.presenceOfElementLocated(By.id("**")));
      driver.manage().window().maximize();
      
      driver.findElement(By.id("**")).click();
      
      driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);


      

      

      
      try {
             Robot robot = new Robot();
             robot.keyPress(KeyEvent.VK_F6);
      
             robot.keyRelease(KeyEvent.VK_F6);
            
             robot.keyPress(KeyEvent.VK_ENTER);
             robot.keyRelease(KeyEvent.VK_ENTER);
            
                 } catch (AWTException e) {
                    e.printStackTrace();
                  }
      

}

}

The requirement is:
open a webpage
Click on the excel icon to download the file.
then a popup appears.
upon clicking on F6 and enter the file gets saved.
the problem here is as soon the code is run, the robot class does not wait for the icon to be clicked. the steps are not occurring in sequence.
0
Can we open outlook web application using selenium webdriver?

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;



public class test {
	
	
public static void main(String[] args) {
	
	 WebDriver driver;
	 
	System.setProperty("webdriver.ie.driver","**.exe");
	driver=new InternetExplorerDriver();
	driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);

	driver.get("***");

Open in new window


As per the requirement I need to open google.com and then open outlook web application. Using the above code google can be opened.
Could you please help me with the code to open outlook application.
0
Scenario 1:
I have the below method which is common to 3 web elements. I am trying to create a common method in which I can pass any of the 3 web elements as needed so that the method is invoked.

public String clickMethod() throws InterruptedException {
    WebElement link = currentPage.findElement(By.xpath("......')]"));
    String href= link.getAttribute("href");
    return href;
}

I am not sure how to pass webelement as parameter and call in the Testcase. I use pageobject model. the webelement is in the page class and i am trying to call the method and assert in test class.

Scenario 2:
In another case I need to pass 2 web elements and run the same method.

My code is like the one below:

public boolean VerifyResultsAndSelect() throws InterruptedException {
    Webelement1.sendKeys("asdf");
    List<WebElement> selectlist = currentPage.findElements(By.cssSelector("....."));
    System.out.println(selectlist.size());
    if (selectlist.size() == 3) {
        selectlist.get(0).click();
        System.out.println(currentPage.getCurrentUrl());
    }

    return true;
}

i am not sure how to pass 2 webelements as parameters  and call in the Testcase. I use pageobject model. the webelement is in the page class and i am trying to call the method and assert in test class.
0

Selenium

20

Solutions

1

Articles & Videos

38

Contributors

Selenium is a portable software testing framework for web applications. Selenium provides a record/playback tool for authoring tests without learning a test scripting language (Selenium IDE). It also provides a test domain-specific language (Selenese) to write tests in a number of popular programming languages, including C#, Groovy, Java, Perl, PHP, Python, Ruby and Scala. The tests can then be run against most modern web browsers. Selenium deploys on Windows, Linux, and OS X platforms. It is open-source software, released under the Apache 2.0 license, and can be downloaded and used without charge.

Top Experts In
Selenium
<
Monthly
>