New answers tagged

0

driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS); is the correct and cleanest way of doing this in my experience. Call it once after instantiating the driver, and all subsequent calls will correctly wait for whatever timespan specified (60 seconds in this case) It is better to be generous in timeframes for explicit waits, as lower ...


-1

You can do: browser.get('file:///path/to/my/html/file/testing.html') Edit. You are trying to open a html fake page ( I assume for get the HAR content ), also trying to mock the request (you can do it, but it's more difficult than that), when you can get the same result loading the html file from selenium.


0

We use getAttribute("title"); to get the tooltip text of a webelement. In this please make sure that the webelement is not inside another iframe. I found one more thing from the html snapshot you provided. That is the element is having an attribute called "title", whose value is "" (Empty string). So probably you will get printed the empty string. If the ...


-1

ok but, i was talking about using page factory, and methods from page classes which i later use in main class - test class


2

As I understood the question, it is required to define the reusable methods and use those methods in different test cases based on the requirement. Here I am writing the code for two individual methods to work with,... public void inputKeys(WebElement we,String ip){ we.sendKeys(ip); } The above code just type the string value referred by ip variable. ...


-1

click on element first then do sendkeys, and if .click() is not working you can click on the element through taking coordinates of the element on the page or click on it using robot


0

Finally solved it myself. The problem is, that the firefox container should not access localhost, but the web container. Thus, a link to that container is needed. The fixed docker-compose.yml file now looks like web: image: php:5-apache volumes: - .:/var/www/html ports: - "8080:80" links: - db:db db: image: mysql volumes: - ...


0

If you're using chrome, you can go into chrome developer tools and go to the source tab. From there you can pause browser execution using the pause button at the top. Wait for the notification to appear and then pause the browser so it doesn't disappear on it's own. That will let you take your time to observe the html and decide on a css selector that ...


1

This is super odd, in terms of your code though, everything looks correct. the problem does not seem to be on your end. If you call the click method, and selenium times out AFTER the browser performs that click, then the problem is likely with the return trip from the browser's embedded http server that your tests communicate with. Your stack trace also ...


1

Problem solved by this steps: Changed cookie Policy to compatible Changed cookie Implementation to HC3CookieHandler and the last but not least, Internet Explorer Driver has got some problems with getting cookies named, changed to Chrome Driver and now everything works


1

It will be good to do this with firepath, it works well for Firefox browser. And once you know the path you can implement the same (litle changes might be need for explorer though) for other browsers. Please check the link, it has a better explanation for locating an element


2

Try to form the Xpath like //div[@class='promptChoiceListBox']//input[@id='saw_3005_7_1'] Please check the script by finding the element with the above Xpath. Hope it will work because if you take only div tag it will give entire drop down ,but we just need to click on the drop down symbol button in the region of your image added above.


1

Try this First click on the div element. This should open the drop down. Webelement ele1 = driver.findElement(By.XPATH("//div[@class='promptChoiceListBox']")); ele1.click(); Now we need to implement some kind of wait here so that we have a time gap to allow the elements to load //implement some wait here so that element appears WebDriverWait wait = ...


1

In excel sheet always start with 0-column and 0-row and index 0 as well. Change data[i][0]=conf.getData(1, i, 0); data[i][1]=conf.getData(1, i, 1); data[i][2]=conf.getData(1, i, 2); to data[i][0]=conf.getData(0, i, 0); data[i][1]=conf.getData(0, i, 1); data[i][2]=conf.getData(0, i, 2);


0

I had similar problem when our designer used custom elements (with custom tag) in Angular/material. Webdriver was not able to interact with such elements (TESTacy could be right), but I did not spent much time on researching real underlying reason for this - changing the approach was much quicker :-) I ended up tweaking design a bit, generating span ...


1

As per the rules of W3C custom elements are registered by script using document.registerElement(). Now, it may be possible that they are declared or created before their definition is registered by the browser. For example, you can declare on the page but end up invoking document.registerElement('hangout-module') much later. This although this is an HTML ...


0

I can not comment yet, so I will post it as an answer, but it is basically a clarification for Dmitry's answer. .//View[@content-desc='PASSWORD']/../EditText From tree view we can notice that the element we want to access has no unique identifier, but the View which is on the same level of hierarchy has content-desc set to PASSWORD. So, first we can look ...


0

getElementsByTagNameNS is an alternative means to accomplish what you are trying to do. I know that getElementsByTagName changes all values to lowercase to process. Could be its either not counting a capital letter. Example from the API elements = document.getElementsByTagNameNS(namespace, name)


0

One suggestion is to try this, if it is the Click Function itself that doesn't seem to fire you might want to try something like the following: driver.findElement(By.id("searchWhatever")).sendKeys(KEYS.ENTER); IE webdriver has a weird bug that doesn't respond to .click() it just ignores it and fails. So that would explain why it would work in Chrome but ...



Top 50 recent answers are included