New answers tagged

1

Please try with below changes in StandardProductPricingTest public class StandardProductPricingTest extends Page { public static String productID = "7100113022"; HomePageActions home ; GalleryPageActions galleryPage; @BeforeTest public void setUp() { initConfigurationAndLogin(); ...


0

Editing this as I didn't notice that you really have select it then click Download. dropdowndate.click() driver.implicitly_wait(5) try: for i in range(1,1000): selectdate = driver.find_element_by_xpath('(//*[@class="list-view"]//label/span)['+str(i)+']') dates.append(selectdate.get_attribute('title')) driver....


0

Few things to remember: You are doing visibility of all elements located by, this will check the visibility of elements which was identified. If the element with href was not loaded during this time then it won't consider that Your locator div.islrc>div>a detects many elements and few doesn't have href and if href is not available then getAttribute ...


0

I have made it big progress but there is last minor problem left. "df.append(pd.read_html(driver.page_source)[0])" with the code above want to append all the tables in the pages but it append only the first page repetitively. df = pd.read_html(driver.page_source)[0] while True: next_page_btn = driver.find_elements_by_xpath('//*[@id=&...


2

Htmle report in extente report is deprecated from v4.1.3: http://extentreports.com/docs/versions/4/java/v3-html-reporter.html Use spark report instead, http://extentreports.com/docs/versions/4/java/spark-reporter.html The steps remain the same. Only the name changed and everything else works almost the same


0

A solution that works for ANY programming language you want to automate with. This way, your team can automate using any Selenium tool. Using Docker, you can run your own WebDriverManager server, then all you need to do is write really simple code to download drivers from that: # Mac OSX command docker run -p 4041:4041 -v $HOME/wdm:/root/.m2/repository ...


0

In UI everything is accessed as string , we use getText() to retrieve the displayed information so it doesn't make sense to complicate it by converting it to double when we have to actually validate the displayed text . In API test level the json response differentiate values into different types like string , number , null etc . In that case it makes sense ...


0

You shouldn't use hooks to supply WebDriver to your scenarios. Instead use PicoContainer dependency injection framework. Mark the fields of your step class with @Inject annotations Create a class that would implement WebDriver interface and delegate calls to internal driver object that would be lazily initialized. That class should also implement Disposable ...


3

Your HTML code doesn't contain disabled attribute to disable the field its being disabled by the class name x28o xfn p_AFDisabled p_AFTextOnly when it is enabled classname changes to x28o xfn p_AFTextOnly Probably you should validate with the class name instead of using elementisclickable Try this below wait.until(EC.visibility_of_element_located((By....


1

Let's start with looking at what your code is actually doing. List<WebElement> webElements= driver.findElements(By.xpath("//*")); creates a list of every web element on the page. Not just every form field, every element. Every <p>, <br>, <div>,... you get the point. List<WebElement> txtfields = driver.findElements(By....


0

This depends on what are you going to test exactly and on the practices which are adopted in your team. You need to consider the following when you test "numbers" on UI: Representation of a number on UI depends on the locale of the user. For example in some locales fractional part of a number is separated with . symbol, but in some locales with , ...


1

This will help you //p[@class='customer-service']/text()[normalize-space()][1]


0

Create a file say Setup.py in package say common: with below content def getOptions(): chromeOptions=Options() chromeOptions.add_experimental_option("prefs", {"download.default_directory": r"C:\Users\Ads\downloadfolder", "download.prompt_for_download": False, "download.directory_upgrade": True &...


1

In manual launch you would have checked the a tag attributes after clicking image preview flyout Attribute snapshot before image preview Attribute snapshot with image preview Attribute snapshot after closing the image preview


1

If you're dealing with data provider that returns iterator, then you have to return Iterator<Object[]>, not Iterator<Object> Otherwise you will need to return Object[][]


0

The closes you can get to your Katalon example is using Templates with embedded arguments: Verify Prices of All Plans [Template] Account ${account} and ${plan} Should Have Price ${price} Free Android 19.79 Free IOS 19.79 Free Both 24.99 All other logic would be inside Account ${account} and ${plan} Should Have ...


0

This: return getTransactionsTable().findElement(By.xpath("/div[2]//div[@class='col-2 blue-amount text-right']")).getText(); won't work because you start your xpath from /. You need to either add a . at the very beginning or remove / which will make your path relative. Another thing is that here return driver.findElement(By.xpath(".//div[@...


0

A Page Object is simply a design pattern for creating an API for UI manipulation. All you have to do it to provide to the page object a way to fetch a low-level UI manipulation tool, such as Selenium. For instance, through a singleton. class MyTests { @Test fun test1 { val page = FactoryOfPageObjects.newPage("login"); val ...


0

When you construct the page using PageFactory.initElements(driver, POM.class); the new instance of the page is created so that the field that you are referring is still null. What you are doing though is pretty tricky. I would rework your design actually. However changing the mentioned line to PageFactory.initElements(driver, this); might help you.. P.S. - ...


0

You can do this only if you have any of the below informations: Know unique file name of the new download: Then try to open or do something with the file or search for the specific file, till the file is found or exception is not thrown ( catch exceptions and try till there is no error) 2. Unique pattern of the new download eg: file_name+impestamp.xlxs ...


0

Try this: public String whichRadioOptionIsSelected() { try { WebElement selectedOption = findElementByXpath("//div[@id='ButtonOptions']//input[@value='true']/following-sibling::label"); if(selectedOption.isPresent()) return selectedOption.getText(); } catch(Exception e) { ...


0

Try using just //button[@id='createMoreButtonAs22'].


0

You must be getting the wrong input tag. You're locating the search box with //input[@id='search'], I guess what you need is //input[@id='search_submit'].


0

As PDHide pointed out, the Driver you are sending is not used (although you are sending the same instance as you had before. However, the biggest problem is that you are creating a circular dependency graph. It means that any change in any class would require all of them to be re-compiled and re-deployed (and worse of all, means that any change can introduce ...


0

Yes, the tool you want to use is Karate. Here is a 10-thread example I made: https://github.com/djangofan/karate-selenium-grid-example/blob/master/src/test/java/features/google/form.feature Then, you can install AeroKube Moon to get a free scalable 4-thread Grid cluster. If you want more threads, they are $5/thread/month. This is absolutely the cheapest ...


-1

Application developed using Electron are desktop applications. So in simple words you can't automate desktop applications using Selenium. Selenium automates browsers. That's it!


1

When you do driver.findElements(By.xpath("//input[@type='text' or @type='password']")); you just get a list of DOM nodes with specified properties. That doesn't mean they are all ready to take your input. Hence you are encountering some that is not.. There are basically to ways you can to go: Good way: Do not take all inputs. Take the only inputs ...


0

If the span's class value does not include multiple keywords then we can easily extract the element's text using locator "//span[@class ='Trsdu']" with '.text' property. Please refer below code: print("Text Returned", driver.find_element_by_xpath("//span[@class='Trsdu']").text) However, the span element provided in the ...


1

https://selenium-python.readthedocs.io/api.html gives difference between submit() and click(). The submit() function is an easier way to submit a form : from selenium import webdriver username = "Username" password = "Password" driver = webdriver.Chrome("locationpath\\chromedriver.exe") driver.get("website") ...


0

The submit() method should be used on a form element, not a button. On buttons use click() to interact with them.


0

This guy properly explains why you can't do that anymore - “Say goodbye to URLs with embedded credentials” by Leonid Makarov https://link.medium.com/eSAHV8Sfq7 PS: you might want to use https://rungutan.com instead. They support a "login" property for your logic of having "different URL" that can help you.


0

Browsermob-Proxy is a reliable solution, But while working with the remote grid machine, Browsermob-proxy isn't really helpful. Alternatively, I found this as a working solution for my setup. Hopefully, it will be useful for someone with a similar setup. Add the ModHeader extension to the chrome browser How to download the Modheader? Link ChromeOptions ...


0

With the solutions already discussed above the most reliable one is using Browsermob-Proxy But while working with the remote grid machine, Browsermob-proxy isn't really helpful. This is how I fixed the problem in my case. Hopefully, might be helpful for anyone with a similar setup. Add the ModHeader extension to the chrome browser How to download the ...


0

Argh - found it: the file chromedriver. did not have execute-permissions. That wasn't reported as a problem when I instantiated ChromeDriverService - but I also did not create a "regular instance" of it. After setting these permissions, it's running now!


0

Changes in the webpages will cause this type of error. In order to solve that: Try to put it in front of the function that performs the extraction At the start of the for loop if you have one


0

Sorry to revive an old question, but I came here when to trying focus the browser window (using direct calls to chrome remote debugger). In case it helps anyone, I was able to figure it out with this command to chrome "{'method':'Target.activateTarget', 'params':{'targetId':tabId} ,'id':1}" where tabId is the id of the tab as listed in the localhost:9222/...


0

here iam getting org.openqa.selenium.elementnotinteractableexception element not interactable, i have written explicit wait also, please reply with the solution as soon as possible import java.util.Iterator; import java.util.Set; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium....


0

Resolved by adding changing jar version in build.gradle


0

I got the solution. ${rows}= get element count xpath=//*[@id="tableData"]/tbody/tr ${Value}= Get Text xpath=//*[@id="tableData"]/tbody/tr[${rows}]/td[1] It is working for me as expected. Thanks !


0

package test.a1; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.ie.InternetExplorerDriver; public class testDriver { public static void main(String[] args) { // TODO Auto-generated method stub String browser="FireFox"; if(browser=="Chrome") { System....


1

Span inside is usually used for styling so, getText Assumes all child elements are part of the actual text. Couldn't find a direct way to achieve what you are trying to do, The workaround is to : First solution: just get the text from both and replace the unwanted part parent= driver.find_elements_by_tag_name('a') child= driver.find_elements_by_tag_name('...


0

I am not sure what you are trying to do , if you want to make the tr index dynamic just call a variable index. ${nameColumn}= get text xpath=//*[@id="tableData"]/tbody/tr[${index}]/td[9] And write some logic to change value to index as you want


0

childs = Body.find_elements_by_xpath("//*") You are using xpath "//*" which means any element under the root . To find direct child element of body use childs = Body.find_elements_by_xpath("./*") Here . , Means current node which is the body And /* means all direct childs of current node , which is body


1

In my experience, querying the DB to assert content is correct in the front-end is rarely done. The main idea behind the E2E automation tests is to ensure the functionality of the web elements are working and present. Things like: Links are clickable and navigate to the correct page Forms can be filled out User sign up, user login, user modification (...


1

I don't think querying the DB for verification is necessary. Since your app FE is connected to API, you just need to query through API to verify things. The data verification should be done through testing of the APIs themselves.


2

No, Google Chrome in headless mode doesn't supports extensions. In the one of his comment, @alexclarke@chromium.org clearly mentioned: I realize a lot of folks would like to use extensions with headless but unfortunately that's a large project which we have /no plans to do/. The problem is Headless Chromium is a content embedder which means it doesn't ...


0

There might be another reason why you get NoSuchElementException: you are not in the correct iframe. If your element is inside an iframe, you must "move" to it. See https://stackoverflow.com/questions/44834358/switch-to-an-iframe-through-selenium-and-python for an answer in python.


0

I executed script | return ["car", "bus"] | vehicles, then replaced send keys | vehicles | ${iterator} with send keys | css=.XTCL0| ${iterator} this solved the issue.


0

The endpoint https://wbes.wrldc.in/ReportNetSchedule/GetNetScheduleSummary returns a HTML with JS code that contains the data you are looking for. You can either parse this HTML or separate the data from the HTML itself, creating a new endpoint for it (you should, because this is ugly JS). Then you can fetch the data with a simple cURL call.


0

Separate the path with a comma for the next one: --load-extension=path/to/extension,path/to/another/extension Solution from: https://stackoverflow.com/questions/20782557/load-unpacked-chrome-extension-programmatically


Top 50 recent answers are included