RPA basic authentication using autoit

rpa
autoit

#1
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://web-harvest.sourceforge.net/schema/1.0/config"
	charset="UTF-8" scriptlang="groovy">

	<selenium-flow>
		<selenium browser="internet explorer" name="seleniumDriver"
			start-in-private="false" close-on-completion="true">

			<selenium browser="autoit" name="winDriver"
				close-on-completion="true">

				<script><![CDATA[
					import java.util.concurrent.TimeUnit;

					driver = seleniumDriver.getWrappedObject();
					driver.manage().timeouts().implicitlyWait(200, TimeUnit.SECONDS).pageLoadTimeout(200, TimeUnit.SECONDS);
					driver.get("http://test.webdav.org/auth-basic/");
				]]></script>


				<script><![CDATA[
					import java.util.concurrent.TimeUnit;

					aDriver=winDriver.getWrappedObject();

					aDriver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS).pageLoadTimeout(1, TimeUnit.SECONDS);

					aDriver.switchTo().window("[CLASS:#32770]");
					aDriver.findElement(By.cssSelector("[CLASS:Edit; INSTANCE:1]")).sendKeys("user9");
					aDriver.findElement(By.cssSelector("[CLASS:Edit; INSTANCE:2]")).sendKeys("user9");

					aDriver.findElement(By.cssSelector("[CLASS:Button; INSTANCE:2]")).click();

					Thread.sleep(4000);
				]]></script>
				
				<script><![CDATA[ 
				
					//Continue to work with IE browser using driver variable
				
				]]></script>
			</selenium>

		</selenium>

	</selenium-flow>

	<export include-original-data="true" />
</config>

#2

@mstrok, @dborovko

Can we do that sam in simplified API?


#3

@mabramchik
The current implementation of SAPI allows you to work with only one driver instance.

Best Regards
Kanstantsin Sheleh


#4

Example using SAPI

<?xml version="1.0" encoding="UTF-8"?>
      <script><![CDATA[
            timeouts(200 * 1000);
            open("http://test.webdav.org/auth-basic/");
        ]]></script>
  </selenium>
  <selenium browser="desktop" name="winDriver" close-on-completion="true">
  		<script><![CDATA[
  			timeouts(1000);
  			switchTo().window("[CLASS:#32770]");
  			$("[CLASS:Edit; INSTANCE:1]").sendKeys("user9");
  			$("[CLASS:Edit; INSTANCE:2]").sendKeys("user9");
  			$("[CLASS:Button; INSTANCE:2]").click();
  			sleep(4000);
  		]]></script>
  	</selenium>
  <selenium browser="internet explorer" name="ie" start-in-private="false" close-on-completion="true">
      <script><![CDATA[
  			//Continue to work with IE browser using driver variable
  	]]></script>
  </selenium>