1

I am running my this script is jmeter. It is working fine. But I am executing the same script in blazemeter there it was giving this error.

I am using Firefox version is 45. and `Permission denied to access property 'M'what it means,

I have used 45 version of firefox becuase jmeter supports for this version. so I have used that.

Below error it is giving,

2017/12/21 09:43:48 ERROR - com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler: Sourced file: inline evaluation of: ``import org.apache.jmeter.services.FileServer; import org.openqa.selenium; import . . . '' : Method Invocation wait.until : at Line: 21 : in file: inline evaluation of: ``import org.apache.jmeter.services.FileServer; import org.openqa.selenium; import . . . '' : wait .until ( ExpectedConditions .visibilityOfElementLocated ( By .id ( "userEmail" ) ) ) 

Target exception: org.openqa.selenium.WebDriverException: Permission denied to access property 'M'

My code is,

import org.apache.jmeter.services.FileServer;
import org.openqa.selenium;
import org.openqa.selenium.firefox.FirefoxProfile;
import java.time.temporal.ChronoUnit;
import java.time.format.DateTimeFormatter;  
import java.time.LocalDateTime;   
import org.openqa.selenium.WebElement;
import org.openqa.selenium.By;
import java.io.FileReader;
import java.io.BufferedReader;
import java.io.FileWriter;
import java.util.concurrent.TimeUnit;
import java.util.ArrayList;
import java.util.List;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.support.ui.ExpectedConditions;
WebDriverWait wait= new WebDriverWait(WDS.browser,220);
WDS.sampleResult.sampleStart();
WDS.browser.get("https://app.mammoth.io/#/login");

wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("userEmail"))).sendKeys(new String[] {"deepak.merahkee@gmail.com"});
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("userPwd"))).sendKeys(new String[] {"*************"});

WDS.log.info("oasdfhdsf");

login=wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//button[@class='btn btn-mammoth']")));
start=LocalDateTime.now();
login.click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//section[@class='workspace ng-scope']")));

end=LocalDateTime.now();
Long minutesBetween=ChronoUnit.MILLIS.between(start,end);
String Timestamp = Long.toString(minutesBetween);

WDS.log.info("Login: login = "+Timestamp);
WDS.browser.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);  

WDS.sampleResult.sampleEnd();

It is give this error,

2017/12/21 09:43:39 INFO - jmeter.util.JMeterUtils: Setting Locale to en_US 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Loading user properties from: /usr/sbin/apache-jmeter-3.1/bin/user.properties 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Loading system properties from: /usr/sbin/apache-jmeter-3.1/bin/system.properties 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Setting JMeter property: beanshell.server.file=/tmp/blazemeter.bsh 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Setting JMeter property: beanshell.server.port=53900 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Setting JMeter property: blazemeter.machine_ip=35.199.37.40 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Setting JMeter property: jmeter.save.saveservice.connect_time=true 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Setting JMeter property: jmeterengine.nongui.port=4455 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Setting JMeter property: sample_variables=in 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Setting JMeter property: InstanceID=0 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Setting JMeter property: EngineIndex=0 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Setting System property: file.encoding=UTF8 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Setting System property: user.dir=/home/jmeter 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Setting System property: sun.net.inetaddr.ttl=20 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Setting System property: networkaddress.cache.ttl=20 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Copyright (c) 1998-2016 The Apache Software Foundation 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Version 3.1 r1770033 
2017/12/21 09:43:40 INFO - jmeter.JMeter: java.version=1.8.0_141 
2017/12/21 09:43:40 INFO - jmeter.JMeter: java.vm.name=OpenJDK 64-Bit Server VM 
2017/12/21 09:43:40 INFO - jmeter.JMeter: os.name=Linux 
2017/12/21 09:43:40 INFO - jmeter.JMeter: os.arch=amd64 
2017/12/21 09:43:40 INFO - jmeter.JMeter: os.version=4.4.0-96-generic 
2017/12/21 09:43:40 INFO - jmeter.JMeter: file.encoding=UTF8 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Max memory =6934757376 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Available Processors =2 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Default Locale=English (United States) 
2017/12/21 09:43:40 INFO - jmeter.JMeter: JMeter Locale=English (United States) 
2017/12/21 09:43:40 INFO - jmeter.JMeter: JMeterHome=/usr/sbin/apache-jmeter-3.1 
2017/12/21 09:43:40 INFO - jmeter.JMeter: user.dir =/home/jmeter 
2017/12/21 09:43:40 INFO - jmeter.JMeter: PWD =/mnt/jmeter 
2017/12/21 09:43:40 INFO - jmeter.JMeter: IP: 10.240.0.14 Name: r-v3-5a3b82000f268-0-0-c FullName: r-v3-5a3b82000f268-0-0-c 
2017/12/21 09:43:40 INFO - jmeter.services.FileServer: Default base='/home/jmeter' 
2017/12/21 09:43:40 INFO - jmeter.services.FileServer: Set new base='/home/jmeter' 
2017/12/21 09:43:40 INFO - jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2 
2017/12/21 09:43:40 INFO - jmeter.save.SaveService: Using SaveService properties file encoding UTF-8 
2017/12/21 09:43:40 INFO - jmeter.save.SaveService: Using SaveService properties version 3.1 
2017/12/21 09:43:40 INFO - jmeter.save.SaveService: All converter versions present and correct 
2017/12/21 09:43:40 INFO - jmeter.save.SaveService: Loading file: FirefoxDriver.jmx 
2017/12/21 09:43:40 INFO - jmeter.samplers.SampleResult: Note: Sample TimeStamps are START times 
2017/12/21 09:43:40 INFO - jmeter.samplers.SampleResult: sampleresult.default.encoding is set to ISO-8859-1 
2017/12/21 09:43:40 INFO - jmeter.samplers.SampleResult: sampleresult.useNanoTime=true 
2017/12/21 09:43:40 INFO - jmeter.samplers.SampleResult: sampleresult.nanoThreadSleep=5000 
2017/12/21 09:43:40 INFO - jmeter.engine.StandardJMeterEngine: Running the test! 
2017/12/21 09:43:40 INFO - jmeter.samplers.SampleEvent: List of sample_variables: [in] 
2017/12/21 09:43:40 INFO - jmeter.samplers.SampleEvent: List of sample_variables: [in] 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Starting Beanshell server (53900,/tmp/blazemeter.bsh) 
2017/12/21 09:43:40 INFO - jmeter.engine.util.CompoundVariable: Note: Function class names must contain the string: '.functions.' 
2017/12/21 09:43:40 INFO - jmeter.engine.util.CompoundVariable: Note: Function class names must not contain the string: '.gui.' 
2017/12/21 09:43:40 INFO - jmeter.JMeter: Running test (1513849420724) 
2017/12/21 09:43:40 INFO - jmeter.engine.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group 
2017/12/21 09:43:40 INFO - jmeter.engine.StandardJMeterEngine: Starting 1 threads for group Thread Group. 
2017/12/21 09:43:40 INFO - jmeter.engine.StandardJMeterEngine: Thread will continue on error 
2017/12/21 09:43:40 INFO - jmeter.threads.ThreadGroup: Starting thread group number 1 threads 1 ramp-up 0 perThread 0.0 delayedStart=false 
2017/12/21 09:43:40 INFO - jmeter.threads.ThreadGroup: Started thread group number 1 
2017/12/21 09:43:40 INFO - jmeter.engine.StandardJMeterEngine: All thread groups have been started 
2017/12/21 09:43:40 INFO - jmeter.threads.JMeterThread: Thread started: Thread Group 1-1 
2017/12/21 09:43:40 INFO - BlazeMeter: BlazeMeter startup script completed 
2017/12/21 09:43:48 ERROR - com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler: Sourced file: inline evaluation of: ``import org.apache.jmeter.services.FileServer; import org.openqa.selenium; import . . . '' : Method Invocation wait.until : at Line: 21 : in file: inline evaluation of: ``import org.apache.jmeter.services.FileServer; import org.openqa.selenium; import . . . '' : wait .until ( ExpectedConditions .visibilityOfElementLocated ( By .id ( "userEmail" ) ) ) 

Target exception: org.openqa.selenium.WebDriverException: Permission denied to access property 'M'
Command duration or timeout: 238 milliseconds
Build info: version: '2.52.0', revision: '4c2593cfc3689a7fcd7be52549167e5ccc93ad28', time: '2016-02-11 11:22:43'
System info: host: 'r-v3-5a3b82000f268-0-0-c', ip: '10.240.0.14', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-96-generic', java.version: '1.8.0_141'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=28.0, platform=LINUX, browserConnectionEnabled=true, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 453818df-7ba8-477b-a939-b26c13ab3a5e
*** Element info: {Using=id, value=userEmail}
in inline evaluation of: ``import org.apache.jmeter.services.FileServer; import org.openqa.selenium; import . . . '' at line number 21 
2017/12/21 09:43:48 INFO - jmeter.threads.JMeterThread: Thread is done: Thread Group 1-1 
2017/12/21 09:43:48 INFO - jmeter.threads.JMeterThread: Thread finished: Thread Group 1-1 
2017/12/21 09:43:48 INFO - jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test 
2017/12/21 09:43:57 INFO - jmeter.JMeter: Command: Shutdown received from /127.0.0.1 
2017/12/21 09:43:58 INFO - jmeter.JMeter: Command: StopTestNow received from /127.0.0.1 

Can anyone help me,since yesterday I am struggling to solve this.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Vidya
  • 382
  • 1
  • 6
  • 17

1 Answers1

0

You have to take care of a couple of things as follows :

  • As you are using an older version of Firefox i.e. v45.x it would be better to identify the WebElements mocking the DOM. So to locate the Email address field you can use the following line of code :

    wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//input[@class='form-control user-email ng-pristine ng-untouched ng-valid-email ng-invalid ng-invalid-required ng-valid-pattern' and @id='userEmail']"))).sendKeys(new String[] {"deepak.merahkee@gmail.com"});
    
  • As the Email address field and Password field both are on the same page and as you have already waited for the Email address field you don't have to wait for the Password field. So you can remove the wait as follows :

    WDS.browser.findElement(By.xpath("//input[@class='form-control user-pwd ng-pristine ng-untouched ng-invalid ng-invalid-required' and @id='userPwd']")).sendKeys(new String[] {"*************"});
    
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • I have tried this. Now, also I am getting same error. – Vidya Dec 26 '17 at 11:06
  • Can you update the question with exactly `Line 20, 21 & 22`. Want to see where the **property 'M'** occurs. – undetected Selenium Dec 26 '17 at 11:41
  • On a seperate note can you change `sendKeys(new String[] {"deepak.merahkee@gmail.com"});` to `sendKeys("deepak.merahkee@gmail.com");` and `sendKeys(new String[] {"*************"});` to `sendKeys("*************");` as they both acieves the same? – undetected Selenium Dec 26 '17 at 11:43