Questions tagged [selenium2]
Use for questions about Selenium 2. Selenium 2 is the second major release of Selenium, an open source framework for testing web applications. A major difference between Selenium 1 and Selenium 2 is the latter's use of WebDriver.
504
questions
3
votes
3answers
67 views
In Page Object Model does all classes need to share a single driver instance?
I can create a BaseTest.java file and declare
Public static WebDriver driver; in it. Then all classes can extend and use the same driver reference.
Then all my test classes can use same instance.
Can ...
-1
votes
1answer
49 views
Amazon Home Page automation
I am trying an automation script with amazon and trying to select the category drop-down on the home page of amazon, but unable to do.
I am providing the code below.
WebElement Catagory = driver....
0
votes
0answers
28 views
Jenkins does not upload a file to the browser when scheduled
I have a selenium script which in requires to upload a file (stored already in the HD) .
This works well when i configure the script with Jenkins and click on "Build Now" button in Jenkins.
...
1
vote
3answers
191 views
How to pass excel column values into different test methods of a class in Java Selenium
I have an excel which contains 4 columns with N rows. Let us say Col1, Col2, Col3, Col4 are the headers.
Now I have a java class and there are 3 methods inside it.
public class test(){
@Test(...
0
votes
0answers
107 views
[[TestNGClassFinder]] Unable to read methods on class
[[TestNGClassFinder]] Unable to read methods on class package.CreateCustomer - unable to resolve class reference org/openqa/selenium/WebDriver
I have created a testNG program and run the program using ...
0
votes
1answer
46 views
java.lang.NullPointerException in Page object Model
I have created this program using TestNG and i'm getting this error java.lan*g.NullPointerException
I have initialized the Webelement .But still i'm getting error
POM.java
package TestPOM;
import java....
-3
votes
1answer
55 views
Why do we create parameterized constructor in every PageObject class which accepts one driver reference when BaseTest has a global driver object? [duplicate]
When every test class will inherit driver, then why should we create constructor that takes driver object?
public class BaseTest{
public static Webdriver driver = new ChromeDriver();
}
public class ...
0
votes
0answers
128 views
How can we use the “TableTransfomer” Method to read data from “DataTable” in Cucumber?
I am stuck with using a TableTransfomer Class to convert Datatable into desired domain object. I am following some examples from the web, but have completely messed up my code.
I just want Cucumber ...
-1
votes
1answer
35 views
What does it mean to instantiate Webdriver in Selenium? [closed]
WebDriver driver = new ChromeDriver();
Now, when we "instantiate" Webdriver and create a reference variable and then assign the object returned to it, then does it mean that we have a new Chrome ...
0
votes
1answer
19 views
Element draged but not droped in destnation
//drag.
WebElement From=driver.findElement(By.xpath("//div[@id='settings']//div[2]"));
Thread.sleep(3000);
// drop.
WebElement To=driver.findElement(By....
0
votes
1answer
360 views
Importing test library 'AutoIt' failed: ModuleNotFoundError: No module named 'AutoIt' Error
I am trying to file upload in modal form using robot/eclipse but its not working. I added autoit library to red.xml. Giving below error .
Below is my code for file upload
Click Element xpath=//*[@...
0
votes
0answers
20 views
How to get data from PDF from URL having authentication using selenium?
I need to automate this flow where a PDF will be opened when i use the URL and enter the authentication.
This flow has to be automated using Selenium. I tried PDFbox API but it works only for URL ...
0
votes
1answer
38 views
Select a day, month and year from calendar picker and copy the date value into a variable [duplicate]
I'm trying to select month, year and date from calendar date-picker. I'm writing my script using pom & page factory approach. I'm not able to pass the date I selected to the variable named ...
0
votes
2answers
54 views
Clicking on a tab using selenium not working
I'm trying to go through this site "https://www.dream11.com/cricket/create-team/1278/17702" and once this site is loaded, I want to click the skip button (which I can do) and then go on each of the ...
0
votes
0answers
173 views
Has anyone used Github Actions to run Selenium Tests on Safari and Macos VM?
Github Actions is a nice way to kick off builds and tests.
However I'm unable to enable the "Allow Remote Automation" setting in Safari from the command line.
I've found a few command line posts ...
2
votes
3answers
307 views
python+selenium+Unittest: get website cookie/manipulate cookie/send back. Possible?
Details:
For our test procedures, we want to read the cookies of a website, manipulate the cookie and read it again.
We want to test if this is possible at all to avoid a security gap.
We use for ...
0
votes
3answers
115 views
Selenium un-enable to find element
I have been through every selenium related page on here but not much else I can really try.
I am trying to click on the text link but It gives me 'org.openqa.selenium.WebDriverException: chrome not ...
0
votes
3answers
2k views
Selenium Webdriver sendKeys method sending value twice
I have 6 selenium tests (TestNG) running on chrome and firefox (both up to date versions) which connect to Browser stack to run.
the problem is that 1 of the test fails intermittently on Chrome as ...
0
votes
4answers
77 views
What is the best way to learn Selenium Webdriver or any Automation tool in general? [closed]
I have purchased a Selenium automation course and practice sometimes as per the code shown in the lecture. But, i am going very slow and circling in basic topics like dropdowns, select tag, waits etc.
...
0
votes
2answers
95 views
What are the things that one must consider while learning Selenium Webdriver Automation framework?
I am a newbie in Automated scripting using Selenium WebDriver with Java. Also, i have the most basic knowledge of core Java.
With tons of resources on the web for learning WebDriver, i am a bit ...
0
votes
2answers
62 views
How can I verify that saved data is displayed corrrectly using Selenium + C#?
<p class="details-info-block__text"><span class="details-info-block__label">Business Address 1:</span> 1010 Priority Way West Dr</p>
I want to verify the address value (e.g. "...
0
votes
1answer
61 views
How to read the excel (Later enter test data in application based on particular test script name)
I need your help, I want to read test data based on the Test script. And after reading data it should enter in the application.
I am using selenium Java + Apache POI
Below is the code please help.
...
1
vote
2answers
880 views
Disable physical mouse and keyboard in selenium
I am trying to run an automated test that requires me to move the mouse around the page.
The problem is that whenever the person running the test moves the physical mouse while the test is running, ...
1
vote
1answer
4k views
How to get the href value from the xpath?
Below is my element location, i need to find the id from this link.
<a href="bnf_view.aspx?QBnfId=BGOOE00003" class="case-hdr" xpath="1">Dean Ambrose</a>
Expecting this output-BGOOE00003
...
-1
votes
1answer
218 views
when I try to launch any driver the webpage is not getting loaded
org.openqa.selenium.firefox.NotConnectedException: Unable to connect
to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
syncGUID":"{4ef3f74f-a8c6-4d0a-9f70-82419b95c42f}","...
0
votes
2answers
141 views
Store values from table for use in later tests
Below is my HTML code. I need to be able to save the names in the table rows (Saurav P, Ranjit M) to use in later tests.
<table cellspacing="0" cellpadding="0" summary="Case managers who sign ...
0
votes
3answers
565 views
How to identify the web-element for a Text Box using Selenium
I am attempting to locate the empty textbox by the input id 'Department_input'
<input id="Department_input" type="text" aria-required="true" size="40" class="field_input ui-widget-content" ...
1
vote
0answers
168 views
How can I integrate google-API-spelling-java (API) in our selenium code to check the spellings? [closed]
To check the grammar and spellings entire application
-1
votes
2answers
61 views
Either its possible to get and show a value from front end in selenium Java. If so, then how I can do this
I am testing a website and I need to perform some action on the basis of Price. It is showing price in Remaining Budget. I want to check the remaining budget and then on the basis of it want to ...
2
votes
2answers
69 views
if/else condition is not working as expected
WebElement radio= driver.findElement(By.xpath("//[@id=\"mydiv\"]/form/div[1]/div[3]/label"));
if (radio.isSelected()){
Thread.sleep(2000);
driver.findElement(By.xpath("//*[@id=\"mydiv\"]/form/...
0
votes
3answers
2k views
Unable to find element with css selector == input[name='username']
WebElement username = driver.findElement(By.cssSelector("input[name='username']"));
The statement mentioned above was working before but right now concerned element can't be captured and error ...
-1
votes
2answers
583 views
How to interact with web elements with the same ID's?
I have three drop-downs with same ID's and want to click each of them, one by one, but it will click the same element three times. The remaining two elements are failing, but that test case is passed.
...
1
vote
3answers
76 views
is there any possibility to check the button sizes and images are loading or not in selenium?
how can I check frontend button sizes, logos, and images are loading or not?
2
votes
2answers
123 views
What is the best way to automate a system, where the XPath is not static?
I have to automate a system, which changes its ID's from time to time, and the XPath is not static.
What is the best way to automate this kind of system?
4
votes
2answers
3k views
How can I handle alert using if else condition in selenium?
else is perfectly executed but if block is not executed - can anyone help me?
WebDriverWait wait = new WebDriverWait(Maf_Base.getDriver(), 10 /*timeout in seconds*/);
if(wait.until(...
1
vote
0answers
22 views
How to print the webservice(jqurey) hit on the console for search functionality
Open a website, press F12 go to network option and enable preserve log
now type the work you want to search eg:dogs
we can see the service "http://search.test.com/search........."
here i want the ...
0
votes
1answer
31 views
Finding an element by tagname's value
In our app that we are using, there are widgets on the page, lots and lots of widgets. There is a HTML tag called widgetkey in it, with an 'id' value associated with it.
Here is the exact HTML:
<...
2
votes
1answer
328 views
Selenium exception is reported twice in logs
I am using Cucumber Page Object model to execute my tests. Here is my POM file:-
<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId&...
0
votes
1answer
1k views
how to run same testcase in 2 different URL in selenium JAVA [closed]
How do I run the same test case in 2 different URL which has same functionality
2
votes
2answers
93 views
How can we automate the fields if there are multiple data components are present on UI and we need find inside elements
I am new to selenium. following are some info. Can someone guide me to create xpath and this is the approach we are using to maintain the UI elements unique, so for this code, will selenium help to ...
-2
votes
1answer
46 views
Double decimal value [closed]
public static String TaxAmount(String totprice,String tax)
{
String strD2=tax;
double totalprice= Double.parseDouble(strD2);
String strDl = totprice.trim();
if(strDl....
1
vote
3answers
3k views
How to accept Alert message in Selenium Java
I tried driver.switchTo().alert().accept(); but still i am unable to accept the alert message. please let me know the code to accept below message.
enclosed screenshot of message and XML
0
votes
1answer
58 views
Fetch paid Amount value from iframe
if(ScenarioName.equals("MoveinwithVantivCard")) {
driver.findElement(By.id("btnsave")).click();
// driver.switchTo().frame("paymentIFrame");
driver.switchTo().frame(driver.findElement(By....
1
vote
1answer
687 views
unable to click modal popup using selenium
I Have an application developed using Electron+Chromium when browser launched without any URL there will be a popup.
This is a modal popup and using selenium I'm unable to handle this popup.
HTML ...
0
votes
2answers
1k views
How to parameterize locator in Selenium
I am new to selenium, And In my scenario I need to select a product for list of products in the page. And Product name to select is a test data. Now my query is,Can I create Object in Class level ( ...
1
vote
3answers
2k views
Multiple @tests but did not execute the priority 2 and priority 3
Can someone let me know why it stops execute after the first @test(priority=1)? It ran the @beforeclass, then @test(priority 1) then @aftermethod. So it skipped @test(prority=2) and @test(priority=3)
...
1
vote
1answer
2k views
How do I use Selenium to drag and drop drawing elements into a canvas?
I have an element with an id which I need to select, then drag and drop into a drawing canvas. How do I do this?
The element is outside the canvas and I need to draw it inside the canvas.
function ...
-1
votes
5answers
11k views
Unable to click on checkbox using Selenium & Java
please send me the full code I tried Some XPath and CSS:
XPath:
//div[@id='autofill']/div/label
//div[4]/div/label
CSS:
div.col-md-1.checkbox.checkbox-primary > label*
but using above ...
3
votes
4answers
22k views
How to handle browser closing popup
In one of my scenario I am filling the form but not submitting due to my requirement. Now I am closing the browser but while closing browser it is browser an alert by saying "Are you sure .... ". How ...
0
votes
3answers
7k views
How do I get particular textNode value of a DOM with Selenium
Hello I am trying to find Load # detail from this site.
Also You can refer screenshot too.
I have tried with xpath: //div[@class='equipment_item']//text()[preceding-sibling::strong[text()='Load #:']][...