Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x

Selenium

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

Hi All we have a string in our selenium tests which we we want to appear as a link in the report we are generating for example <a href=\"{link}\">{link}</a>. The probably is when the html report is generated it converts the < symbol to ;lt; and > to ;gt;. Is there a way we can try and prevent this occurring so the link appears correctly in the report
0
Understanding Web Applications
Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Hi,

This about automating the Application verification.

As part of testing we are verifying some online application every day and seeing the response at the end and confirming that the application working as expected.

Cant we automate this process. If we did that it will reduce 30 mints of our time. Also if this can be done from the UFT tool also fine for me. we dont have selenium in our machine and it is not allowed. Please share your thougths and suggestions if any.
0
Below code was working few days back ago.But suddenly i'm experience this error. I tried implicit,explicit wait, time.sleep but nothing is working out.  I have also verified that element are present.I have checked similar error in stackoverflow , where they have mentioned to use explicit wait. As I mentioned earlier, it's doesn't work. Am I new to selenium , so kindly help me on this issue.

Error code :
driver.find_element_by_xpath("//*[@id='wrapper']/main/div/p[5]/a").click()

Open in new window

Complete code for the  perusal.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
import datetime 
import time 
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from bs4 import BeautifulSoup
from IPython.display import clear_output

def select_elements(system,yy,mm,dd,hr,mins,meridiem):
    select = Select(driver.find_element_by_id('fin_compatibility_system'))
    select.select_by_value(system)

    select = Select(driver.find_element_by_id('fin_gyear'))
    select.select_by_value(yy)

    select = Select(driver.find_element_by_id('fin_gmonth'))
    select.select_by_value(mm)

    select = Select(driver.find_element_by_id('fin_gday'))
    select.select_by_value(dd)

    select = Select(driver.find_element_by_id('fin_ghour'))
    select.select_by_value(hr)

Open in new window

0
1. I load the page
2.input some data
3.click on submit button
4.It does the calculation , and result are shown below in the same page.

In-spite of simplicity wait, page_source doesn't have newly loaded content.

My test code:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
import time 
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from bs4 import BeautifulSoup

driver = webdriver.Chrome('C:\\Users\\Vivekanandhan\\Downloads\\Compressed\\chromedriver_win32\\chromedriver.exe')


driver.get('http://srirangaminfo.com/porutham.php')
#Input Value to the text box
inputElement = driver.find_element_by_id("name2")
inputElement.send_keys('1')

#Select value from the list box 
select = Select(driver.find_element_by_id('fdd2'))
select.select_by_value('4')

select = Select(driver.find_element_by_id('fmm2'))
select.select_by_value('6')

select = Select(driver.find_element_by_id('fyy2'))
select.select_by_value('1986')

select = Select(driver.find_element_by_id('fhr2'))
select.select_by_value('1')

select = Select(driver.find_element_by_id('fmin2'))
select.select_by_value('49')

select = Select(driver.find_element_by_id('fsec2'))
select.select_by_value('0')

select = Select(driver.find_element_by_id('fam2'))
select.select_by_value('1')

Open in new window

0
How to fill autocomplete text in selenium-Python Platform.
I need to enter the city information in the textbox.I tried using key.ARROW_DOWN, Keys.RETURN but it didn't workout. This textbox accepts the information only after clicking on the value from the drop-down list else it don't accept it.  I am not sure how to select option from the drop-down list.
Kindly help on this issue.

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
import time 
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC


driver = webdriver.Chrome('C:\\Users\\Vivekanandhan\\Downloads\\Compressed\\chromedriver_win32\\chromedriver.exe')


driver.get('http://poorvapunya.com/marriage_match_horoscope.php')
girl_name = driver.find_element_by_name("girl_name")
girl_name.send_keys('girl_name')
birth_date_fm= driver.find_element_by_name("birth_date_fm")
birth_date_fm.send_keys('20.9.2017')

select = Select(driver.find_element_by_name('birth_hours_fm'))
select.select_by_value('1')

select = Select(driver.find_element_by_name('birth_minutes_fm'))
select.select_by_value('49')

select = Select(driver.find_element_by_name('birth_ampm_fm'))
select.select_by_value('0')

birth_city_fm = driver.find_element_by_id("birth_city_fm")
birth_city_fm.click()
birth_city_fm.clear()
#birth_city_fm.send_keys('India', 

Open in new window

0
What are steps to install selenium automation in robot framework in ubuntu 16.04 in python?
0
I just wanted to know How can I make selenium test cases run faster?
0
I am new to both Java and Selenium.  Worked on a VMware virtual system with Firefox 54.0.1 (32 bit) and Selenium IDE 2.9.1.  I'm using Eclipse 4.7.0, which is also new to me.

I created a test plan using the IDE's record feature.  I then exported it to with TestNG/Webdriver.

I am getting the following error:

FAILED CONFIGURATION: @AfterClass tearDown
java.lang.NoSuchMethodError: com.google.common.util.concurrent.SimpleTimeLimiter.create(Ljava/util/concurrent/ExecutorService;)Lcom/google/common/util/concurrent/SimpleTimeLimiter;

A full copy of my error listing is attached.  

I'm also attaching the java code. I've removed references to the page I am testing 'cause my company is paranoid.
Errorlisting.txt
Error-Source.txt
0
I am using Log4j2 with the JUL plug-in.

For example:
	... 18 more
1500642924477	Marionette	INFO	New connections will no longer be accepted
1500642924501	addons.xpi	DEBUG	Calling bootstrap method shutdown on webcompat@mozilla.org version 1.1

Open in new window

0
We are using ELK(Elastic search, logstash, and Kibana) for our log management. Everytime I will export the setting from kibana UI from Management--->Save Objects--->Export Everything. For demo, one can checkout the url: Kibana Demo

cURL
I want to automate this export process with some scripting on linux. I tried CURL but the header/payload data looks to be dynamic and might have to update frequently. I want to try some web scraping techniques with some web automation tools like Selenium and pythion.

Selenium Webdriver
I tried to record this export action with Selenium IDE and from the IDE I exported the test plan/case into pythonkibana_python.py . As we click on Export Everything button on Kibana, a firefox window opens asking where to save. This action is not handled by selenium, meaning download file is not supported by selenium.

So, I'm looking for some scripting to export the json(Export Everything) file from Kibana UI and it mush be Headless as I would be scheduling this script in linux server. To be headless, I also tried phantomjs, but even this doesn't support file download.

Simply, I just want a script to automate clicking export everything button on kibana and want it be saved in a file. Please share your thoughts or any idea,  i'm trying this for days...
0
Q2 2017 - Latest Malware & Internet Attacks
Q2 2017 - Latest Malware & Internet Attacks

WatchGuard’s Threat Lab is a group of dedicated threat researchers committed to helping you stay ahead of the bad guys by providing in-depth analysis of the top security threats to your network.  Check out our latest Quarterly Internet Security Report!

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
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 got, or it appeared; an extension/plugin, https://getfirebug.com/wiki/index.php/Selectors_Side_Panel, that tells me, Go! is the attribute of css selector "input"
<input onclick="showAlert()" value="Go!" type="button">

Open in new window


I've been searching for, what I believe I once saw; driver.findElement(By.cssSelector(input[@attribute = "Go!"])) ;
But this does not work.  How does one use css Selector with an attribute?
0
Hello,
I'm looking for the right findElement setting for the login button.  I had it working at one time with id="u_0_q", but then it stopped working.  I'm using Window 10 Edge Webdriver
What could work?  The first three lines are the DOM locator.  The first line looks to be a frame, before the login button.
The login button is that of www.facebook.com login
//<label class="uiButton uiButtonConfirm" id="loginbutton" for="u_0_q">
//<input tabindex="4" id="u_0_q" type="submit" value="Log In" data-testid="royal_login_button"
//></label>
				//driver.findElement(By.xpath("html/b[b]/b]ody/div[1]/div[1]/div/div/div/div/div[2]/form/table/tbody/tr[2]/td[3]/label/input")).click();
		//driver.findElement(By.cssSelector("input[data-testid=royal_login_button]")).click();
		//driver.findElement(By.id("u_0_q")).click();
		//driver.findElement(By.cssSelector("input[value=royal_login_button")).click();//absolute not work
		//driver.findElement(By.id("loginbutton")).click();//works for Edge!
		//driver.findElement(By.id("loginbutton")).click();

Open in new window

0
Hello,
I had and now I still have firebug installed on firefox.  The problem I have, and I do not know how it used to be; but when I ran my Selenium Webdriver code (the firefox browser would be openned) and hit F12 the firebug/firepath would be available.  

Am I wrong on this thought?
Now I have to open a separate firefox browser, and when I fit F12, I do get the firebug and firepath.

My thought is that I added some "add-on" that disabled firebug on a selemium webdriver test browser page.
I can't find a way to list the installed add-ons in firefox.  Do you know how?
0
Hello,
I'm looking for an xpath tool, like the one that firefox has.  I have searched and do not find one.  I find xpath helper and Finder for Chrome.
For IE Edge I find nothing.
Is there an xpath for Chrome and Edge?
xpath Finder seems to work on the fact that you already know the xpath.

Can an xpath from firefox be used in Chrome and Edge?
0
Hello, I
The <input name> DOM line below is similar to one that I have used this Webdriver; driver.findElement(By.className("whsOnd zHQkBf"))
to enter my username.  When I click on the button "Next," the page moves on to the page to enter the password.
This is the line for the password;
<input name="password" tabindex="0" class="whsOnd zHQkBf" dir="ltr" spellcheck="false" aria-label="Enter your password" type="password" jsname="YPqjbf" data-initial-value="" data-initial-dir="ltr" autocomplete="current-password" autocorrect="off" autocapitalize="off">

You'll see that the same class name is used, yet the driver.findElement(By.className("whsOnd zHQkBf")) is not working.
Why?  I don't see any other className or id to use.  What can be used?  The test site is gmail.com
0
I would like a crash course in Selenium as a C# developer and prefer to reach versus watching video.

Any good visual tutorials I can read?

It'd be great if there were C# programming exercises as well.

Thanks
0
I am new to using Selenium for web UI testing, but see it as a great tool for that. Can it also be used for load testing?

If so, how does that work? How do you handle concurrency?

Thanks.
0
Simplify Your Workload with One Tool
Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

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
Was able to launch and close browser 1 only.
            
Error:


java.lang.NullPointerException
      at java.util.Hashtable.put(Unknown Source)
      at java.util.Properties.setProperty(Unknown Source)
      at java.lang.System.setProperty(Unknown Source)
      at newpackage.Launchbrowsers.Browser(Launchbrowsers.java:32)
      at newpackage.Launchbrowsers.main(Launchbrowsers.java:13)

Thanks in advance for any help.
0
In this Selenium test, can you explain what this call to By.XPath is doing exactly?

string referenceLink = browser.FindElement(By.XPath("/html/body/div[@class='container body-content']/div[@class='page-wrap']/div[@class='container']/div[@class='box-container jumbotron border']/div[@class='row'][1]/div[@class='col-sm-12 col-md-6 col-lg-3'][1]/a[@class='thumbnail text-center']")).GetAttribute("href").Remove(0, 8);
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
What kinds of things do I need to know in order to get started with automated tests with Selenium? I have experience with unit testing, but no front-end testing yet.

I am interested in smoke testing, best practices, what kinds of guidelines to use when making a test plan with Selenium.

I am interested in hearing how other people use it...

Thanks.
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

Selenium

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
>