Questions tagged [selenium-webdriver]

Used for questions about using Selenium WebDriver, a browser automation framework frequently used to automate testing in a browser.

Filter by
Sorted by
Tagged with
0
votes
2answers
28 views

how do find xpath when only value is given in the source code

What will be the xpath of a 'Search' button from the expression mentioned above
0
votes
2answers
33 views

How do I click on an element available in a specific row where dynamic row is added?

In the below pic, I need to click on the icon in a row which is newly added and column1 value is stored as global variables. Have used the below code, unable to find a solution. WebElement ...
0
votes
3answers
87 views

How should I fail a test when an if condition becomes false

I want a test to fail when the if condition below becomes false. last_url = self.browser.current_url if 'https://***/news/' in last_url: print("test passed") else: #Test should fail if it ...
1
vote
1answer
830 views

C# Selenium WebDriver Foreach not working

This is my code in C# I press the delete button and open a pop up where I select the amount of deletions that I want to delete and press again on delete it will delete. PropertiesCollections....
1
vote
4answers
4k views

How can I execute selected test cases from list of testcases in TestNG at runtime?

I want to create a page with the details of test cases (say a HTML Page with some content). Say the testcases will be listed there. When i want to run the test cases then I will select them and click ...
0
votes
1answer
52 views

Selenium: how to prevent a just-started Chrome window from receiving focus

Using Selenium + chromedriver on Linux, like so; chrome_options = Options() driver = webdriver.Chrome('/usr/bin/chromedriver',options=chrome_options) driver.get('https://www.somewebsite.com') Chrome ...
1
vote
3answers
40 views

Selenium web driver Java: not able to select a value from a drop down list

I'm trying to select an option from a drop down list, and I'm not able using the common methods of the Select class. I also tried the selectByVisibleName and selectByValue and same result. Select ...
0
votes
2answers
2k views

How to get Embed link from Openload API after Remote upload? Selenium & Python

im trying to use Openloads API in python, i can do a remote upload like this: ol_url = driver.current_url resp = ol.remote_upload(ol_url) file_id = resp.get('id') Now i have a file uploaded in ...
0
votes
1answer
124 views

What is the good practice to instantiate page object in POM and PageObjectFactory?

I am practicing POM and Page Object factory. I would like to learn good practices in instantiating the pages. till now I am Instantiating the pages from test class (e.g. TC_01_Register.java) using ...
1
vote
1answer
30 views

How to run selenium script recorded using Selenium IDE along with jMeter?

Here are the steps I have followed so far.... 1) Recorded steps using Selenium IDE 2) Then I export it (".side" file) into a java(junit 4) file. 3) Created a maven project and added the ...
0
votes
1answer
43 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 ...
0
votes
0answers
39 views

Cannot instantiate class tests.LoginPageTest

package tests; import java.net.MalformedURLException; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.testng.annotations.AfterTest; import org.testng....
0
votes
1answer
29 views

How to write test that have same code in the beginning?

I am writing test automation for the application that have following features Login Create News Create Event In Create News and Create Event I have to repeat login code. Is there a way to use login ...
-2
votes
0answers
18 views

WebDriver cannot resolved and chrome driver cannot be resolved to a type

This type of error occurred when writing the Testing program. WebDriver cannot be resolved and chrome driver cannot be resolved to a type. Can anyone help me with this?
0
votes
2answers
24 views

c# element not interactable

I am unable to click login form element below site http://www.w-trading.co.kr/member/login.php? I try driver.FindElement(By.XPath("//*[@id='memberId']")).SendKeys("my_id"); and driver....
3
votes
3answers
149 views

How to abstract data classes to be more object oriented?

I have run into problems keeping my tests as object-oriented as possible. I have had to rewrite large portions of my code multiple times now, and I feel that there is a better approach to what I'm ...
0
votes
1answer
476 views

App is launched but not able to perform further actions (App automation using appium)

I am new in mobile app automation I have successfully launched Google Playstore application in my android device. but,i can not click on next tab "GAMES". My Code package com.automate.app.screens; ...
0
votes
2answers
103 views

How Does Test Planning Differ for Manual and Automation Projects?

I am now into automation projects. So can anyone help how the test plan will differ from manual and automation projects.?
3
votes
4answers
43k views

How to get value of text wrapped in paragraph element <p> with Selenium in Java

I have a button, clicking on it generates a number which is wrapped in paragraph text such as <p>random number <p> , I want to get that random number value and do operations based on ...
0
votes
0answers
14 views

run Unittests from bin Folder instead of ..\Out\… in MSTest

I am working with 'VS 2017, Version 15.9.12', I work with a Unit-Testproject but currently when I debug a test my IDE always runs the Test in the "....\TestResults\testuser_notebook1065 2019-06-11 ...
0
votes
1answer
23 views

User Acceptance Tests with mouse/keyboard capture and picture compare

We have several Angular applications (Micro UIs) and they are all 100% covered by our UATs (User Acceptance Tests) written with Protractor (Angular Test Framework based on Selenium). There are ...
1
vote
1answer
86 views

How to split a variable in Selenium IDE?

I am quite new to Selenium IDE. I want to split an error message and extract the first word of the error message. I have used the following commands as in the image. Following are the results of the ...
0
votes
2answers
58 views

Getting nullpointer exception for 2nd test case working fine for login

Driver set to null for 2nd test case, working fine for login. Driver class: public class Driver { private static WebDriver driver;; /** * * @return * @throws Exception */ public static ...
-1
votes
1answer
36 views

What should be Assert for below code, tried for assertTrue,assertFalse,assertNull and assertNotNull

I have written below code to verify web table data headers and value of rows and columns but when I am adding different assertion for it, its not working and throwing compilation error. Can any one ...
1
vote
1answer
40 views

Azure Access to Internal Selenium Server

Asking those network people smarter than me....We are currently testing out DevOps but one thing that I can't do is have MSTest hit our internal server (which is housed in Azure) that contains ...
0
votes
2answers
143 views

How to perform click on an element using selenium for which I am getting staleState Exception

Problem: There are couple of radio buttons with the same ID and I need to perform click on these. The first radio button gets the click where the second one is getting StaleElementReferenceException. ...
1
vote
1answer
40 views

Is there a way to disable the logs created by the pagefactory

Could someone please let me know if there is any way we can disable the logs generated by the page factory for Chrome and Firefox I did try the below options for chrome and firefox and I had also ...
0
votes
4answers
244 views

Not able to click on menu using Selenium WebDriver Java

I am not able click on the specific element, which is in the image format. I have tried using available locators i.e id and image using XPath and remaining locators are same for all remaining menus. ...
0
votes
1answer
18 views

Switching from inner iFrame to the outter (parent) iFrame

I have an iFrame in another iFrame, I´am able to switch to the parent iFrame and then to the child iFrame, but I´am just not able to switch back to the parent one. Is it even possible to switch up top ...
6
votes
3answers
76 views

Testing Real World Objects - Interview

I have a Junior QA interview coming up, and I was asked to learn the basics of Selenium. I have done this through free tutorials. I am fine with the Selenium concepts, but I was told I would be asked ...
0
votes
1answer
18 views

remote webdriver in Linux

I have the following setup for my selenium tests: Hub machine in Linux. Couple of virtual machines as nodes, Linux and Windows created using Vagrant scripts. If I start selenium node in Linux ...
0
votes
1answer
23 views

how to use assert in selenium python to check my page load time is less than 5 sec?

start2 = datetime.datetime.now() button8 = driver.find_element_by_xpath("//span[contains(text(),'Last Month')]").click() timeout = time.time() + 60 * 2 while len(driver.find_elements_by_css_selector(...
0
votes
1answer
26 views

Compilation error when iterating through While loop, compilation error at line no. 10, start of While loop

I am getting compilation error when trying to store list size value into an int. public class HandleWebTable { private static WebDriver driver; public HandleWebTable(){ super(); } public ...
-1
votes
1answer
29 views

How to assert links count on web page through selenium webdriver

I have written below code in a separate class to count links on a particular webpage, How to assert this in a test case class: public static void navigateToLinkInHomePage() throws Exception { ...
0
votes
1answer
20 views

Not able to inspect one of the overlay which disappears in fraction of sec before page loads completely

Once i reset the password through selenium script the confirmation overlay page just remains for 2 sec which i`s not captured by selenium to inspect. Please suggest me how to capture/ignore that ...
1
vote
2answers
4k views

How to open browser with extension already enabled

I get the following code to open chromedriver with extension but this extension is disabled, Is there any way that when chrome is launched, it launch with enabled extension - chrome_options = ...
0
votes
1answer
128 views

When i run my appium code during run time i am getting this error “Exception in thread ”main“ java.lang.NoClassDefFoundError”?

I have written a code to launch my app and click on the element, the app is launching but after launching when it is trying to click, I am getting an error which I am not able to understand why. ...
0
votes
1answer
26 views

Selenium deprecated org.open.selenium.internal.Locatable

I am starting a project by using a library that depends on the said interface. The library worked well with Selenium 3.14.0. The moment I decided to upgrade Selenium, this deprecation has caused a ...
1
vote
2answers
32 views

Can not choose button with the same name (Windows)

The problem I have two buttons with the same name in Windows program. So I do: "self.driver.find_element_by_name("button name").click()" - it selects the first one, but I need the second one. I ...
0
votes
4answers
64 views

How to find broken links using Selenium C#? [closed]

Script for testing broken links using Selenium C#.
4
votes
2answers
7k views

Why drag and drop is not working in Selenium Webdriver?

I am trying to drag an element into another element using Selenium WebDriver but it's not working. I tried all the solutions which I can find on internet but none of the solutions seems to be working ...
2
votes
1answer
123 views

how to click an available time slot in customized UI calendar

I have customized UI calendar attached in screenshot having date and time slots to book some test drive. actually the booked slot div contains some class and available slot contains some class name . ...
1
vote
0answers
24 views

How can i use an existing existing chrome browser instance in selenium C#

How do I use an existing chrome browser in selenium C# ? Currently I have the following but it always creates a new window SessionId sessionId = new SessionId(""); var driver = new phantomJSDriver();...
-1
votes
1answer
49 views

Why tests fail when run in eclipse after creating through selenium IDE?

I have created many tests using Selenium IDE and exported into java files in order to run in eclipse. All tests work properly in Selenium IDE but when I run in eclipse(java file) it creates following ...
0
votes
2answers
46 views

How to find an new element recently added on webpage dynamically after drag and drop in selenium?

Currently I am working on a webpage which has rappid js components. I am trying to achieve dragging and dropping of elements from the palette as seen in the screenshot to the grid. The element I drag ...
0
votes
1answer
33 views

How to get content of clickable element. Facing issue to read content after clicking an element

I have tried below code: if(webElement2.isDisplayed()) { webElement.explicitWaitToClickElement(4,webElement); webElement2.click(); } String tagContent = (String) ((...
1
vote
1answer
36 views

How do I store a value in a global variable and then use it in subsequent steps of a scenario in protractor cucumber typescript based project

I want to retrieve a value in 'Given' function and then store it in a global variable so that the value is accessible in subsequent steps of a scenario in protractor cucumber typescript based ...
0
votes
1answer
44 views

Unable to execute single tc, login then run other application features, right now its running as a suite

I have to execute my test cases as a single as well as a suite, right now its running as a suite but not as a single test case in selenium webdriver: Below is my test which are calling methods present ...
2
votes
4answers
52k views

How to determine whether element is clickable or not? [closed]

My Question is How to check whether the element is clickable or not ?.Is there any method to chat that like isElementVisible() or IsElementPresent() and etc ... Please let me know if one is having a ...