java - selenium cannot run on eclipse -
this question has answer here:
package com.confirm; import org.openqa.selenium.alert; import org.openqa.selenium.by; import org.openqa.selenium.webdriver; import org.openqa.selenium.firefox.firefoxdriver; import org.testng.annotations.test; public class confirmdemo { webdriver driver = new firefoxdriver(); @test public void exampleforconfrim() throws interruptedexception { driver.manage().window().maximize(); driver.get("file:///c:/confirm.html"); thread.sleep(2000); driver.findelement(by.xpath("//button[@onclick='confirmfunction()']")); alert alert=driver.switchto().alert(); system.out.println(alert.gettext()); alert.dismiss(); driver.close(); } } this first selenium program. type code in eclipse , add external jar files selenium, when run eclipse says :
the selection cannot launch, , there no recent launches.
how solve this?
it looks issue has more eclipse selenium, check out this question , it's answer.
Comments
Post a Comment