selenium Getting this error how to resolve - selenium

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method id(String) is undefined for the type String
at Demo.Registration.main(Registration.java:12)

at third last line
System.out.println("selenium.getPageSource()"); .
you don't have to give quotes it has to like
String source = selenium.getPageSource();
System.out.println("Page Source :"+source);
or direct also in print statement
System.out.println("Page source : "+selenium.getPageSource());

Related

SystemC ERROR: type name requires a specifier or qualifier

I am trying to write synthesizable SystemC code.
My code:
struct test:sc_module{
sc_in<sc_lv<4>> inp;
sc_out<sc_lv<4>> outp;
void run(){
sc_lv<4> temp = inp.read();
outp.write(temp);
}
SC_CTOR(test){
SC_METHOD(run);
sensitive << inp;
}
};
I am able to simulate the code, but when I run synthesis, Vivado HLS v.2019 throws the following errors. Can someone please help me understand how to fix this error?
ERROR: [HLS 200-70] Compilation errors found: In file included from test2/test.cpp:1:
test2/test.cpp:4:18: error: use of undeclared identifier 'inp'
sc_in<sc_lv<4>> inp;
^
test2/test.cpp:4:21: error: type name requires a specifier or qualifier
sc_in<sc_lv<4>> inp;
^
test2/test.cpp:4:21: warning: declaration does not declare anything [-Wmissing-declarations]
sc_in<sc_lv<4>> inp;
When I add spaces between the angular brackets (as below), it does not throw an error, and synthesis runs successfully.
sc_in< sc_lv<4> > inp;
sc_out< sc_lv<4> > outp;

java.lang.IllegalArgumentException: Cannot find elements when the XPath expression is null error displaying while sending keys through Method

Getting error while Sendkeys through methods.
public static void enterTask(String task) throws Exception {
// Entering task name
GUIFunctions.typeTxtboxValue(driver,By.xpath(ObjRepoProp.getProperty("enterTaskName_XPATH")),task);
Thread.sleep(5000);
}
But while send keys directly it is working fine.
driver.findElement(By.xpath(ObjRepoProp.getProperty("enterTaskName_xpath"))).sendKeys("qaz");
You have used incorrect key in ObjRepoProp.getProperty() method. See below:
GUIFunctions.typeTxtboxValue(driver,By.xpath(ObjRepoProp.getProperty("enterTaskName_XPATH")),task);
driver.findElement(By.xpath(ObjRepoProp.getProperty("enterTaskName_xpath"))).sendKeys("qaz");
The key "enterTaskName_xpath" is used as "enterTaskName_XPATH". Below code should work:
GUIFunctions.typeTxtboxValue(driver,By.xpath(ObjRepoProp.getProperty("enterTaskName_xpath")),task);

How to list `cannot resolve symbol` warnings in groovy code? (IntelliJ)

I want to list all cannot resolve symbol warnings in my groovy code. I set severity level of Groovy->Probable bugs->Access to unresolved expression in my inspection profile to Warning. IntelliJ does highlight the cannot resolve symbol warnings in edit view but it does not list the problems in the list of problems after I run Analyze->Inspect Code....
I'm using IntelliJ IDEA 15.0.2.
Running inspection on the following piece of groovy code responds with a message No suspicious code found though fooo() is highlighted.
class Example {
def foo() {
fooo() // highlighted as `Cannot resolve symbol 'fooo'`
}
}
You are looking for static compilation behavior. Please use #CompileStatic for it
import groovy.transform.CompileStatic
#CompileStatic
class Example {
def foo() {
fooo() // highlighted as `Cannot resolve symbol 'fooo'`: shows as error in IJ14
}
}

Handling exception in Javaparser

I am trying to handle the exception produced by Javaparser library due to token error. I used the following code.
String content=getTheSource();
ByteArrayInputStream bin=new ByteArrayInputStream(content.getBytes());
try
{
CompilationUnit cu=JavaParser.parse(bin);
} catch (Exception e) {
// TODO Auto-generated catch block
//e.printStackTrace();
//my handling code here
}finally{
bin.close();
}
However, the exception was never caught and I am getting a different exception generated from somewhere else. I got this exception:
Exception in thread "main" japa.parser.TokenMgrError: Lexical error at line 1, column 16. Encountered: "#" (35), after : ""
at japa.parser.ASTParserTokenManager.getNextToken(ASTParserTokenManager.java:2247)
at japa.parser.ASTParser.jj_ntk(ASTParser.java:9986)
at japa.parser.ASTParser.ClassOrInterfaceBody(ASTParser.java:926)
at japa.parser.ASTParser.ClassOrInterfaceDeclaration(ASTParser.java:604)
at japa.parser.ASTParser.TypeDeclaration(ASTParser.java:524)
at japa.parser.ASTParser.CompilationUnit(ASTParser.java:269)
at japa.parser.JavaParser.parse(JavaParser.java:81)
at japa.parser.JavaParser.parse(JavaParser.java:94)
at misc.CompileTest.main(CompileTest.java:45)
Any idea, how to handle the exception? Thanks in advance
As the name indicates, TokenMgrError is an error. So you have to catch an Error instead of Exception. If you want to catch both Error and Exception, you can use Throwable instead.
Originally, this error is throwed by JavaCC (TokenMgrError) which is used by Javaparser.
From version 3 on, JavaParser will/should not throw this error anymore.

Symfony 2 File Upload. How to throw exception on move()

Reading the symfony docs, http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html
// you must throw an exception here if the file cannot be moved
// so that the entity is not persisted to the database
// which the UploadedFile move() method does automatically
$this->file->move($this->getUploadRootDir(), $this->path);
But if I did
if ($this->file->move(...))
I got an error
Catchable Fatal Error: Object of class Symfony\Component\HttpFoundation\File\File could not be converted to boolean in .../xxx.php line 96
look at the source code : https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/File/File.php#L108
It seems that an exception is already thrown.
Cheers