-1
ссылки
изображения ((green box is an input text field, red box is an alert message, i need to print this alert message in eclipse consoleкак получить/печать оповещения текста в мое окно консоли Eclipse в селене Использование JavaScript
driver.findElement(By.xpath("//input[@id='pick_up_pincode']")).sendKeys("577205");
driver.findElement(By.xpath("//input[@id='drop_pincode']")).sendKeys("560001");
driver.findElement(By.xpath("//button[@class='btn btn-raised btn-default show-sls btn-design']")).click();
//Alert alert=driver.switchTo().alert(); (as this is to handle window, but my webpage is displayed as shown in attached window)
//System.out.println(alert.getText());
// alert.accept();
здесь HTML-теге
<span style="color: rgb(255, 0, 0);" id="pick_up_pincode_error"><b>Sorry ! This pincode is not serviceable.</b> </span>
<span style="color:#ff0000;display: none;" id="pick_up_pincode_empty">Please enter the pincode</span>
<input class="form-control index-color" id="pick_up_pincode" maxlength="6" pattern="([0-9]|[0-9]|[0-9])" placeholder="Enter pick up pincode" value="" type="text">
Я думаю, что DOM должен содержать тег html для этого текста предупреждения. Вы пытались его проверить? –
Вы правы, для текста предупреждений использовался тег html. Можно ли распечатать это на консоли? – shreyas