Showing posts with label Selenium WebDriver Spot. Show all posts
Showing posts with label Selenium WebDriver Spot. Show all posts

Tuesday, August 18, 2020

Error: Could not create the Java Virtual Machine.

 ---------------------------

Java Virtual Machine Launcher

---------------------------

Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.

---------------------------

OK   

--------------------------------------------------------------------------------------------------------------------

To resolve the above issue that occurs while opening eclipse, 

1. Open Eclipse.ini file from eclipse folder.

2. Above -vmargs statement enter -vm C:\Program Files\Java\jdk-14.0.2\bin

save and close. Open eclipse again the issue should be resolved.







Monday, May 18, 2015

Set Value to Select Area object

<td>
<input id="txtEditCampaignId-1513" value="" type="hidden">
<textarea id="txtCampaignName-1513" style="width:350px;height:100px"></textarea>
</td>

The following code identifies text area element and sets value to it.

WebElement CmpTxtArea = driver.findElement(By.xpath("//*[starts-with(@id,'txtCampaignName')]"));
CmpTxtArea.sendKeys("Text Area Success");


Sunday, May 10, 2015

How to fix Eclipse starting Error that returns Java was started but returned exit code = 1

If eclipse couldn't be opened and returns the error message as Java was started but returned exit code = 1




1. Uninstall all the existing java applications
2. Install JDK 8 64 bit based on your windows os
 a. Search JDK 8 64 bit in chrome
 b. Open the first result on oracle site
 c. Under Java SE Development Kit 8u45 select windows *64 link and download it.
 d. Open and Install it
3. The path installed on program files installed should set path default to it. Click open eclipse now, it should open successfully.

If again the same issue exist, open eclipse.ini file and update the -vm C:\Program Files\Java\jdk1.8.0_45\bin\javaw.exe

Save and open eclipse, it should open successfully.


Friday, May 8, 2015

Selecting sub menu while mouse hover top menu

In the above image Tools menu needs to be selected first and then sub menu should be selected.  In selenium webdriver the following package needs to be imported to use class Actions.

Use this class rather than using the Keyboard or Mouse directly. Implements the builder pattern: Builds a CompositeAction containing all actions specified by the method calls.

Pls. refer  http://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/interactions/Actions.html for action class methods and constructors.

To implement Actions class, the following package needs to be imported

import org.openqa.selenium.interactions.Actions;

linkText method of findElement method directly gets the link which has innerText within it. The below code can select the sub menu item.


Actions action = new Actions(driver);

WebElement mnuTools = driver.findElement(By.linkText("Tools"));

action.moveToElement(mnuTools).build().perform();

driver.findElement(By.linkText("Ad Copy Manager Internal")).click();