You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to automate a new scenario where we open the Outlook application and follow below steps.
Enter to email address.
Enter subject.
Enter email content.
Able to automate till Step 1 and Step 3. Only step 2 is not being identified. PFB the below source code. Tried all possible combinations for subject properties. Tried to find it using name - "Subject" and using class name and also automation id. But no luck. Kind of stuck and need help regarding the same.
Thank You.
package test;
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import java.io.IOException;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import Allocator.Allocator;
public class MSOutlook extends Allocator {
public void openOutlook() throws InterruptedException, IOException {
setupEnvironment("Outlook");
Thread.sleep(10000);
}
public void sampleOps() {
driver.findElement(By.name("File Tab")).click();
driver.findElement(By.name("Exit")).click();
}
public void sendEmail() throws InterruptedException, AWTException {
driver.findElement(By.name("New Email")).click();
Thread.sleep(2000);
WebElement to = driver.findElement(By.name("To"));
WebElement cc = driver.findElement(By.name("Cc"));
WebElement sub = driver.findElement(By.className("Static"));
to.sendKeys("[email protected]");
sub.sendKeys("Subject");
//Insert Subject
driver.findElement(By.name("Page 1 content")).sendKeys("Test Email");
driver.findElement(By.name("Send")).click();
driver.close();
}
public static void main(String args[]) throws InterruptedException, IOException, AWTException {
MSOutlook c = new MSOutlook();
c.openOutlook();
c.sendEmail();
}
}
The text was updated successfully, but these errors were encountered:
Trying to automate a new scenario where we open the Outlook application and follow below steps.
Able to automate till Step 1 and Step 3. Only step 2 is not being identified. PFB the below source code. Tried all possible combinations for subject properties. Tried to find it using name - "Subject" and using class name and also automation id. But no luck. Kind of stuck and need help regarding the same.
Thank You.
The text was updated successfully, but these errors were encountered: