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

Hellow,

Kindly guide me for control v keys (paste) for selenium web driver for Chrome i use following Combinations and Searched Over Internet Various Ways but vain.
sendkeys keys.control + "v"
sendkeys Keys.control&"v"
sendkeys Keys.control,"v"

I use VBA Excel to Excute copy a range from sheet to paste into web.whatsapp.com a contact everything working but control + v paste not working.

Regards,
0
Improve Your Query Performance Tuning
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

Experts, I have started working on Selenium and would need your help in finding XPATH of webpage elements in browsers. If there is any tutorial using which I can help find the right xpath to elements using developer tools, it will greatly help. Thanks.

Just to add, I have used the chrome Inspect Element -> XPath option, but would like to know if there are other non-browser tools or plugins which are more friendlier and descriptive.
0
After installing Selenium IDE in Windows 10, the system is getting Auto-off !
0
I have wrote a python script to open arround 1k urls and process them to get the desired result,but it seems like eventhough multithreading has been introduced its working slowly, and after some urls have been processed,the process seems to be hanged, I am not able to decide whether its still running or stopped.How can I create multiple threads to process them faster.Any help will be highly appreciated.Thanks in Advance. Below is my script.

import threading
from multiprocessing.pool import ThreadPool
from selenium import webdriver
from selenium.webdriver.phantomjs.service import Service
from selenium.webdriver.common.desired_capabilities import
DesiredCapabilities
from selenium.webdriver.remote.webdriver import WebDriver as
RemoteWebDriver
from multiprocessing.dummy import Pool  # This is a thread-based Pool
from multiprocessing import cpu_count
import csv

def fetch_url(url):
    driver = webdriver.PhantomJS()
    driver.get(url)
    html = driver.page_source
    print(html)
    print("'%s\' fetched in %ss" % (url[0], (time.time() - start)))

def thread_task(lock,data_set):
    lock.acquire()
    fetch_url(url)
    lock.release()

if __name__ == "__main__":
    data_set = []
    with open('file.csv', 'r') as csvfile:
        spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')
        for row in spamreader:
            data_set.append(row)

    lock = threading.Lock()
    # data set will contain a list of 1k urls
    for url in…
0
I want to automate a task. in a website we give the details in the fields (like 10 fields information need to fill) and click on submit and in the next page we need to confirm and proceed. Depending on the result whether it is success or not, capture the result and send via email or put the result in a different website and save the result in that website.

Also this process of checking information in site1 by giving information in fields and saving it in a different website need to be done at a scheduled time daily or on days we select to run this job.

I want to know to achieve this task, which method/tools can be used with using robust tools that does not require licensing requirement. Please guide me how to proceed with this task.
0
A discussion about automated testing of Web Applications utilizing Selenium, along with illustrated configuration steps for the Jenkins open source tool.
0
from selenium import webdriver
dr=webdriver.Chrome()
dr.get('https://www.google.com')
text=str('good day ')
dr.execute_script("document.getElementById('lst-ib').setAttribute('value','"+text+"')")


This works fine , but when i use xpath
dr.execute_script("document.getElementByXPath('//*[@id='lst-ib']').setAttribute('value','"+text+"')")

I am getting Error . Kindly anyone help me with this
0
Hi there!

I have an issue preparing an installation of Python/IDLE in one of my client's team computers. Basically, I prepared a couple of scrappers using Python and Selenium. The packages being used on my scripts are selenium, openpyxl, and python-docx.
However, I can't even get to installing the packages on that machine, because one I execute the Python installer from the website (3.6.x), the insteller won't. I tried using admin rights, disabling antivirus, I checked the correct processor architecture, and I still can't get to run the installer on that particular machine. In other team members I was able to installe in their machines. I have run out of ideas to trouble shoot this. Could you please point me to things that I can try out to run the installer Python/IDLE installer?

Thank you so much!
Any help is greatly appreciate it.
0
Hi there!

I have an issue preparing an installation of Python/IDLE in one of my client's team computers. Basically, I prepared a couple of scrappers using Python and Selenium. The packages being used on my scripts are selenium, openpyxl, and python-docx.
However, I can't even get to installing the packages on that machine, because one I execute the Python installer from the website (3.6.x), the insteller won't. I tried using admin rights, disabling antivirus, I checked the correct processor architecture, so I give up trying to install the officitial distirbution in that machine. In other machines I don't have this problem.

So I was wondering if you could recommend other Python distributions for windows that can enable me to run my scripts using the mentioned package? I saw some alternatives such as PyCharm, but I am not sure if that will help.

Can someone confident recommend some for this case?

Thank you so much!
Any help is greatly appreciate it.
0
Hi,

I have a somewhat challenging problem.
I just created a simple page object model in Selenium with C#. It has the following structure.


This is HomePage.cs
namespace CostcoTravel_UITest.Pages
{
    public class HomePage: BasePage
    {
        private By VacationPackageMenu = By.Id("nav_vacation_packages");
        private By CruisesMenu = By.Id("nav_cruises");
        private By RentalCarsMenu = By.Id("nav_rental_cars");
        private By HotelsMenu = By.Id("nav_hotels");
        public HomePage(IWebDriver _driver) : base(_driver) { }

        public CruisesPage NavigateToCruisesPage()
        {
            Repository.Driver.FindElement(CruisesMenu);
            return new CruisesPage(_driver);
        }
        public VacationPackagesPage NavigateToVacationPackagePage()
        {
            Repository.Driver.FindElement(VacationPackageMenu);
            return new VacationPackagesPage(_driver);
        }
        public RentalCarsPage NavigateToRentalCarsPage()
        {
            Repository.Driver.FindElement(RentalCarsMenu);
            return new RentalCarsPage(_driver);
        }
        public HotelsPage NavigateToHotelsPage()
        {
            Repository.Driver.FindElement(HotelsMenu);
            return new HotelsPage(_driver);
        }
    }
}

Open in new window

And the following is VacationPackagesPage.cs
namespace CostcoTravel_UITest.Pages
{
    public class VacationPackagesPage: BasePage
    {
        private By HomeMenu = By.Id("nav_home");
        public VacationPackagesPage(IWebDriver _driver) : base(_driver) { }

        public HomePage NavigateToHomePage()
        {
            Repository.Driver.FindElement(HomeMenu);
            return new HomePage(_driver);
        }
    }
}

Open in new window

my UnitTest1.cs class look like this:
[TestClass]
    public class UnitTest1
    {               
        [TestMethod]
        public void TestMethod1()
        {            
            HomePage hp = new HomePage(Repository.Driver);
            hp.NavigateToVacationPackagePage();
        }
    }

Open in new window

I know that this is typical way to create Navigation methods in each class like this.
But With this way, I will have too many  Navigation methods.
so, I would like to create a generalized Navigation method in BasePage class and all other classes can use it.
so in UnitTest1.cs class, I can call it by providing page name.
I would look like this:
public [pageName] NavigateTo(pageName){
       repository.Driver.FindElement(WebElementInPageName);
 return new [PageName](_driver);
}

Open in new window

 
In here pageName is a "destination page"
maybe I should provide "WebElementInPageName" as well?

Then, I can call it in UnitTest.cs class like
HomePage hp = new HomePage(Repository.Driver);
 hp.NavigateTo(VacationPackagePage);

Open in new window

or
hp.NavigateTo(VacationPackagePage, WebElementInPageName);

Open in new window

0
Become an IT Security Management Expert
Become an IT Security Management Expert

In today’s fast-paced, digitally transformed world of business, the need to protect network data and ensure cloud privacy has never been greater. With a B.S. in Network Operations and Security, you can get the credentials it takes to become an IT security management expert.

I`m a manual Quality Assurance. I really need an automation in my hard work. How should I good start? Have you any ideas? I use Selenium and C++ at my work. But is a basic C++ enough? I was thinking to go to college to take some C++ credits there. Maybe there something like https://domywriting.com/ which could help me in my work. I`m really lost in it because I don`t have the Computer science degree.
0
How to download the audio file from google meaning using python platform?  

I tried using ffmeg package but it's not working. Any small sample script could help me.


Thanks in Advance!!!
0
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 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
Firewall Management 201 with Professor Wool
Firewall Management 201 with Professor Wool

In this whiteboard video, Professor Wool highlights the challenges, benefits and trade-offs of utilizing zero-touch automation for security policy change management. Watch and Learn!

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

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
>