This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function getProtectedProperty($class, $propertyName) | |
{ | |
$reflectObj = new \ReflectionObject($class); | |
$extensions = $reflectObj->getProperty($propertyName); | |
$extensions->setAccessible(true); | |
return $extensions->getValue($class); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function setProtectedProperty($class, $propertyName, $setValue) | |
{ | |
$reflectObj = new \ReflectionObject($class); | |
$extensions = $reflectObj->getProperty($propertyName); | |
$extensions->setAccessible(true); | |
$extensions->setValue($class, $setValue); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function runProtectedFunction($class, $methodName, $args = null) | |
{ | |
$reflectMethod = new \ReflectionMethod($class,$methodName); | |
$reflectMethod->setAccessible(true); | |
if ($args == null) | |
{ | |
return $reflectMethod->invoke($class); | |
} else | |
{ | |
return $reflectMethod->invokeArgs($class, $args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Random generator in range | |
* | |
* @param minimum Number | |
* @param maximum Number | |
* @return randomNumber | |
*/ | |
public int randomGenerator(int minimum, int maximum) { | |
Random rn = new Random(); | |
int range = maximum - minimum + 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->markTestSkipped('This test is scipped '); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Base.db_connection; | |
import org.json.JSONObject; | |
import java.sql.*; | |
import static Base.TestPropertiesLoader.getDbConnectionDetails; | |
public class DbConnection { | |
public Connection con = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.*; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.io.IOException; | |
/** | |
* this class is needed for Java to connect to SOCKS proxy server | |
* Unfortunately Java cannot resolve remote DNS and therefore, when we set System.properties | |
* with our proxy server details, we hit incorrect server . This is because | |
* Java is connecting to Proxy, but DNS is resolving with system details and therefore goes to server directly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yaml | |
import json | |
yml = "file_path" | |
data = yaml.load(open(yml,'r')) | |
json = json.dumps(data) | |
print(json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static JSONObject getJSONFromFile(String path) throws JSONException, IOException, ParseException { | |
JSONParser parser = new JSONParser(); | |
Object obj = parser.parse(new FileReader(path)); | |
return new JSONObject(obj.toString()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void refreshPage(){ | |
driver.navigate().refresh(); | |
} |
OlderNewer