Found the solution for the above program, by rearranging URl value we can achieve this.
URL url = new URL("http://www.myntra.com/women-sarees?nav_id=606&s=tn#!pricerange=2799:9099");
String str =url.toString();
int index = str.indexOf("pricerange");
String before = str.substring(index);
String SubValue = before.substring(E_index);
String value1 = SubValue.substring(1,5);
String value2 = SubValue.substring(6);
String newValue1 = "3000";
String newValue2 = "5000";
String beforeurl = str.substring(0,63);
String newUrl = beforeurl+newValue1+":"+newValue2; System.out.println("New URL -> "+newUrl); driver.get(newUrl);
How to set specif value in slider ...?
-
01-07-2022 - |
Frage
I am able to move the slider but not able to set slider on specific value.
WebDriver driver = new FirefoxDriver();
driver.get("");
WebElement Slider = driver.findElement(By.xpath("//*[@id='slider-range']/a[1]"));
Actions moveSlider = new Actions(driver);
Action action = moveSlider.dragAndDropBy(Slider, 30, 0).build();
action.perform();
Lösung
Andere Tipps
You can use the moveByOffset()
method to move the slider to a particular point.
WebElement Slider = driver.findElement(By.xpath("//*[@id='slider-range']/a[1]"));
Actions builder = new Actions(driver);
Action dragAndDrop =
builder.clickAndHold(Slider).moveByOffset(xOffset,yOffset).release().build();
dragAndDrop.perform();
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow